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.
This commit is contained in:
Leonid Nikitin 2024-06-11 22:44:48 +05:00
parent af053b4d53
commit 0f07c8c6ab
Signed by: kor-elf
GPG Key ID: 3C0F720C170F6E1D
2 changed files with 8 additions and 2 deletions

View File

@ -5,7 +5,10 @@ if [ "$role" = "app" ]; then
exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit
elif [ "$role" = "queue" ]; then elif [ "$role" = "queue" ]; then
echo "Running the queue..." 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 elif [ "$role" = "websockets" ]; then
echo "Running the websockets..." echo "Running the websockets..."
php /var/www/html/artisan reverb:start --port=9000 php /var/www/html/artisan reverb:start --port=9000

View File

@ -5,7 +5,10 @@ if [ "$role" = "app" ]; then
exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit
elif [ "$role" = "queue" ]; then elif [ "$role" = "queue" ]; then
echo "Running the queue..." 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 elif [ "$role" = "websockets" ]; then
echo "Running the websockets..." echo "Running the websockets..."
php /var/www/html/artisan reverb:start --port=9000 php /var/www/html/artisan reverb:start --port=9000