From c4acc2159e783d542f950f5c77524e8e56ad0972 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 22 Mar 2026 18:49:43 -0400 Subject: [PATCH] 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. --- inventoryManager.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inventoryManager.lua b/inventoryManager.lua index 4cb2ef7..d74d390 100644 --- a/inventoryManager.lua +++ b/inventoryManager.lua @@ -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