From b105ca0552870c7cb445848ccd734c00503aa5d6 Mon Sep 17 00:00:00 2001 From: Roman Sevko Date: Mon, 12 Dec 2022 16:23:26 +0300 Subject: [PATCH] switched from 'restart' to 'delete & start' for pm2 workers --- .platform/hooks/postdeploy/10_start_workers.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.platform/hooks/postdeploy/10_start_workers.sh b/.platform/hooks/postdeploy/10_start_workers.sh index d11d63c0f..5283497c6 100644 --- a/.platform/hooks/postdeploy/10_start_workers.sh +++ b/.platform/hooks/postdeploy/10_start_workers.sh @@ -1,8 +1,11 @@ #!/bin/bash -## (re)start workers -pm2 restart /var/app/current/girderformindlogger/external/rq_worker.sh --name=worker_1 -pm2 restart /var/app/current/girderformindlogger/external/rq_worker.sh --name=worker_2 +## delete workers +pm2 delete all || echo 'No workers found' + +## start workers +pm2 start /var/app/current/girderformindlogger/external/rq_worker.sh --name=worker_1 +pm2 start /var/app/current/girderformindlogger/external/rq_worker.sh --name=worker_2 ## start scheduler -pm2 restart /var/app/current/girderformindlogger/external/rq_scheduler.sh +pm2 start /var/app/current/girderformindlogger/external/rq_scheduler.sh