From 0f07c8c6abe4fc8d1d7c4fa1110b75cfc502a17c Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 22:44:48 +0500 Subject: [PATCH] Improved queue launch in Docker. Now it does not die, but in a loop inside it restarts php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600. --- app/docker/start_dev.sh | 5 ++++- app/docker/start_prod.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/docker/start_dev.sh b/app/docker/start_dev.sh index 007ea47..8ee0609 100755 --- a/app/docker/start_dev.sh +++ b/app/docker/start_dev.sh @@ -5,7 +5,10 @@ if [ "$role" = "app" ]; then exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit elif [ "$role" = "queue" ]; then echo "Running the queue..." - php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 + while [ true ] + do + php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600 + done elif [ "$role" = "websockets" ]; then echo "Running the websockets..." php /var/www/html/artisan reverb:start --port=9000 diff --git a/app/docker/start_prod.sh b/app/docker/start_prod.sh index e4d2379..8ee0609 100755 --- a/app/docker/start_prod.sh +++ b/app/docker/start_prod.sh @@ -5,7 +5,10 @@ if [ "$role" = "app" ]; then exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit elif [ "$role" = "queue" ]; then echo "Running the queue..." - php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600 + while [ true ] + do + php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600 + done elif [ "$role" = "websockets" ]; then echo "Running the websockets..." php /var/www/html/artisan reverb:start --port=9000