From 90ee8d491365c0782d82f206af457f33065ad4c8 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sat, 28 May 2022 00:14:42 +0400 Subject: [PATCH] Added timeouts to waitFor calls, apparently it can hang. --- plugins/cron/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/cron/init.lua b/plugins/cron/init.lua index 8da8a35..8de228b 100644 --- a/plugins/cron/init.lua +++ b/plugins/cron/init.lua @@ -219,7 +219,7 @@ end) -- load timer events for k,v in pairs(config.events.timer) do sync_emitter:emit("createEventEntry",k,v,true) - local cor, ev, hash = sync_emitter:waitFor("eventEntryCreated") + local cor, ev, hash = sync_emitter:waitFor("eventEntryCreated",4000) if (not cor) or (not ev) then log("INFO","Retrying in 2 seconds") timer.setTimeout(2000,function() @@ -233,7 +233,7 @@ for _,evtype in pairs(config.events.event) do events.event[_] = {} for k,v in pairs(evtype) do sync_emitter:emit("createEventEntry",k,v,false,_) - local cor,ev,hash = sync_emitter:waitFor("eventEntryCreated") + local cor,ev,hash = sync_emitter:waitFor("eventEntryCreated",4000) if (not cor) or (not ev) then log("INFO","Retrying in 2 seconds") timer.setTimeout(2000,function()