actually set it to 30

This commit is contained in:
Kan18 2022-12-28 19:22:38 +04:00
parent 76b310d873
commit 0a42551ab7
1 changed files with 5 additions and 5 deletions

View File

@ -197,19 +197,19 @@ end
local function cleanNetwork() local function cleanNetwork()
for _,c in pairs(_G.network) do for _,c in pairs(_G.network) do
local elapsed = os.clock()-c.timestamp local elapsed = os.clock()-c.timestamp
if c.active and elapsed > 90 then if c.active and elapsed > 50 then
c.active = false c.active = false
os.queueEvent('network_detach', c) os.queueEvent('network_detach', c)
end end
end end
end end
-- every 60 seconds, send out this computer's info -- every 30 seconds, send out this computer's info
-- send with offset so that messages are evenly distributed and do not all come at once -- send with offset so that messages are evenly distributed and do not all come at once
Event.onTimeout(math.random() * 60, function() Event.onTimeout(math.random() * 30, function()
sendInfo() sendInfo()
cleanNetwork() cleanNetwork()
Event.onInterval(60, function() Event.onInterval(30, function()
sendInfo() sendInfo()
cleanNetwork() cleanNetwork()
end) end)
@ -223,4 +223,4 @@ Event.on('turtle_response', function()
end) end)
-- send info early so that computers show soon after booting -- send info early so that computers show soon after booting
Event.onTimeout(math.random() * 4 + 1, sendInfo) Event.onTimeout(math.random() * 2 + 1, sendInfo)