chore(inferium-harvester): better debug messages
This commit is contained in:
parent
6071fdb6b4
commit
97bb32b544
@ -274,16 +274,20 @@ local function fetchRemotePlan()
|
||||
print('> fetch remote plan')
|
||||
local message = { type = 'getplan' }
|
||||
|
||||
while true do
|
||||
local replyMessage, _ = net.sendQuery(INFERIUM_SERVER, message, NETWORK_TIMEOUT)
|
||||
print('> fetched')
|
||||
local lastErrMessage = nil
|
||||
|
||||
while true do
|
||||
local replyMessage, errMessage = net.sendQuery(INFERIUM_SERVER, message, NETWORK_TIMEOUT)
|
||||
if replyMessage and replyMessage.payload then
|
||||
previouslyFetchedRemotePlan = replyMessage.payload
|
||||
return replyMessage.payload
|
||||
elseif previouslyFetchedRemotePlan then
|
||||
print('> failed to fetch remote plan, use the previous one instead')
|
||||
return previouslyFetchedRemotePlan
|
||||
elseif not replyMessage and errMessage then
|
||||
if lastErrMessage ~= errMessage then
|
||||
print('> failed to fetch: ' .. tostring(errMessage))
|
||||
end
|
||||
end
|
||||
|
||||
os.sleep(IDLE_TIME)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user