From da824fb57276a8bd9b116054e79852e9296278a3 Mon Sep 17 00:00:00 2001 From: Shubham Kanodia Date: Tue, 2 Jan 2024 21:09:19 +0530 Subject: [PATCH] Update timeout --- server/queues.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/queues.ts b/server/queues.ts index 16f2e10..36dbf24 100644 --- a/server/queues.ts +++ b/server/queues.ts @@ -19,7 +19,8 @@ config({ function killAllBullMQProcesses(processName: string) { if (process.env.NODE_ENV !== "production") return; - const command = `ps aux | grep '${processName}' | grep -v grep | awk '{print $2}' | xargs -r kill -9`; + const ageInSeconds = 30; + const command = `ps aux | grep '${processName}' | grep -v grep | awk '{split($10,a,":"); if (a[1] * 60 + a[2] > ${ageInSeconds}) print $2}' | xargs -r kill -9`; try { execSync(command); console.log(`Killed processes with name containing '${processName}'`);