From 9135d17629cc4f4af45334b86a86419379ef4cad Mon Sep 17 00:00:00 2001 From: Semisol Date: Fri, 8 Oct 2021 18:34:35 +0300 Subject: [PATCH] refresh and refreshall conflict --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index a74007a..51fa8ff 100644 --- a/index.js +++ b/index.js @@ -141,6 +141,10 @@ bot.on("privmsg", msg => { msg.reply(`ERROR: No such server`) return } + if ((temp.inProgress > 0 || temp.queue.length > 0) && temp.isRefreshAll) { + msg.reply("ERROR: A refresh all is already running. Please try again later.") + return + } let ports = state.networkState[args[0]] temp.expiryState = {...state.expiryState} delete temp.expiryState[args[0]] @@ -172,6 +176,10 @@ bot.on("privmsg", msg => { break } case "refreshall": { + if (temp.inProgress > 0 || temp.queue.length > 0) { + msg.reply("ERROR: Other jobs are currently running, try again later.") + return + } let jobs = 0 let servers = 0 temp.expiryState = {}