fix: prevent early return in parallel tasks from killing waitForAny
Task 12 (supply chest) and Task 13 (network) returned immediately when not configured, which caused parallel.waitForAny to exit and the entire program to silently stop after cache build.
This commit is contained in:
@@ -478,7 +478,9 @@ local function main()
|
||||
|
||||
-- Task 12: Supply chest (builder / manifest-based stocking)
|
||||
function()
|
||||
if cfg.SUPPLY_CHEST == "" or #cfg.SUPPLY_MANIFEST == 0 then return end
|
||||
if cfg.SUPPLY_CHEST == "" or #cfg.SUPPLY_MANIFEST == 0 then
|
||||
while true do sleep(3600) end
|
||||
end
|
||||
log.info("SUPPLY", "Stocking %s with %d item types", cfg.SUPPLY_CHEST, #cfg.SUPPLY_MANIFEST)
|
||||
while true do
|
||||
pcall(ops.supplyChest)
|
||||
@@ -488,7 +490,9 @@ local function main()
|
||||
|
||||
-- Task 13: Network order/command listener
|
||||
function()
|
||||
if not ctx.networkModem then return end
|
||||
if not ctx.networkModem then
|
||||
while true do sleep(3600) end
|
||||
end
|
||||
while true do
|
||||
local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
|
||||
if channel == cfg.ORDER_CHANNEL and type(message) == "table" then
|
||||
|
||||
Reference in New Issue
Block a user