From 70a5371bdb5ecc61770c0cfb7a4a37cc21e4bc23 Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Thu, 28 Mar 2024 15:59:27 +0100 Subject: [PATCH] MSL-API restart handler: tweak for reliability The MSL-API restart handler worked unreliably because it hit race conditions in Supervisorctl. Added sleep time between actions to reduce the likelihood of such failures. --- roles/msl_api/handlers/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/msl_api/handlers/main.yml b/roles/msl_api/handlers/main.yml index c16f91b..8c9fc3c 100644 --- a/roles/msl_api/handlers/main.yml +++ b/roles/msl_api/handlers/main.yml @@ -10,7 +10,7 @@ # Call command, rather than module, because module doesn't work # right on Ubuntu 20.04 - name: Restart Laravel Worker Process # noqa command-instead-of-module - ansible.builtin.command: supervisorctl restart laravel-worker:laravel-worker_00 + ansible.builtin.shell: sleep 6 && supervisorctl stop laravel-worker:laravel-worker_00 && sleep 6 && supervisorctl start laravel-worker:laravel-worker_00 - name: Reload MSL-API configuration ansible.builtin.command: /usr/bin/php8.0 artisan config:cache