diff --git a/package-lock.json b/package-lock.json index acc7f115..377af083 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "http-proxy": "^1.18.1", "log-rotate": "^0.2.8", "validate-color": "^2.2.1", - "xmppjs-chat-bot": "^0.2.3" + "xmppjs-chat-bot": "^0.2.4" }, "devDependencies": { "@peertube/feed": "^5.1.0", @@ -12026,9 +12026,9 @@ } }, "node_modules/xmppjs-chat-bot": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/xmppjs-chat-bot/-/xmppjs-chat-bot-0.2.3.tgz", - "integrity": "sha512-yoCozt3Qezrb/F8UMAYj21FqV5Jzu58x9M6d7eCSD2yNz1O04qkTc5c1oXR288HXpwVQCWcEP6vfH+Ij2AoJAA==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/xmppjs-chat-bot/-/xmppjs-chat-bot-0.2.4.tgz", + "integrity": "sha512-gS6oS9tpRENjrx5nr++PmlYZF6LlvsmLQqS56Di8npASIY9nXS7Ka+OvK13Kb6mzVTiR7HyG9qYQQLKVYpoUhg==", "funding": [ "https://paypal.me/JohnXLivingston", "https://liberapay.com/JohnLivingston/" @@ -21248,9 +21248,9 @@ } }, "xmppjs-chat-bot": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/xmppjs-chat-bot/-/xmppjs-chat-bot-0.2.3.tgz", - "integrity": "sha512-yoCozt3Qezrb/F8UMAYj21FqV5Jzu58x9M6d7eCSD2yNz1O04qkTc5c1oXR288HXpwVQCWcEP6vfH+Ij2AoJAA==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/xmppjs-chat-bot/-/xmppjs-chat-bot-0.2.4.tgz", + "integrity": "sha512-gS6oS9tpRENjrx5nr++PmlYZF6LlvsmLQqS56Di8npASIY9nXS7Ka+OvK13Kb6mzVTiR7HyG9qYQQLKVYpoUhg==", "requires": { "@xmpp/client": "^0.13.1", "@xmpp/component": "^0.13.1", diff --git a/package.json b/package.json index 8f661581..9731b98e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "http-proxy": "^1.18.1", "log-rotate": "^0.2.8", "validate-color": "^2.2.1", - "xmppjs-chat-bot": "^0.2.3" + "xmppjs-chat-bot": "^0.2.4" }, "devDependencies": { "@peertube/feed": "^5.1.0", diff --git a/server/lib/bots/ctl.ts b/server/lib/bots/ctl.ts index 69921603..1794a2b4 100644 --- a/server/lib/bots/ctl.ts +++ b/server/lib/bots/ctl.ts @@ -124,15 +124,16 @@ class BotsCtl { this.moderationBotProcess as ReturnType let resolved = false - // Trying to kill, and force kill if it takes more than 1 seconds + // Trying to kill, and force kill if it takes more than X seconds + const ms = 2000 const timeout = setTimeout(() => { try { - this.logger.error('Moderation bot was not killed within 1 seconds, force killing') + this.logger.error('Moderation bot was not killed within ' + ms.toString() + 'ms, force killing') moderationBotProcess.kill('SIGKILL') } catch (_err) {} resolved = true resolve() - }, 1000) + }, ms) moderationBotProcess.on('exit', () => { if (resolved) { return }