This commit is contained in:
John Livingston 2023-09-19 17:18:33 +02:00
parent 8b9da417b3
commit de9de8e358
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
3 changed files with 12 additions and 11 deletions

14
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -124,15 +124,16 @@ class BotsCtl {
this.moderationBotProcess as ReturnType<typeof child_process.spawn>
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 }