Skip to content

Commit

Permalink
Set run once for clear-scheduler-cache at startup (#72)
Browse files Browse the repository at this point in the history
* fix WARN clear-scheduler-cache_00 entered FATAL state, too many start retries too quickly

* run migrations and seed via env RUN_MIGRATIONS

* wip

---------

Co-authored-by: mortexa <[email protected]>
  • Loading branch information
denistorresan and smortexa authored Apr 30, 2024
1 parent 1f9cd51 commit 5ad9113
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deployment/octane/FrankenPHP/supervisord.frankenphp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ command=php %(ENV_ROOT)s/artisan schedule:clear-cache
user=%(ENV_USER)s
autostart=%(ENV_WITH_SCHEDULER)s
autorestart=false
startsecs = 0
startretries = 1
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
stdout_logfile_maxbytes=0
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
Expand Down
2 changes: 2 additions & 0 deletions deployment/octane/RoadRunner/supervisord.roadrunner.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ command=php %(ENV_ROOT)s/artisan schedule:clear-cache
user=%(ENV_USER)s
autostart=%(ENV_WITH_SCHEDULER)s
autorestart=false
startsecs = 0
startretries = 1
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
stdout_logfile_maxbytes=0
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
Expand Down
2 changes: 2 additions & 0 deletions deployment/octane/Swoole/supervisord.swoole.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ command=php %(ENV_ROOT)s/artisan schedule:clear-cache
user=%(ENV_USER)s
autostart=%(ENV_WITH_SCHEDULER)s
autorestart=false
startsecs = 0
startretries = 1
stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
stdout_logfile_maxbytes=0
stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log
Expand Down
9 changes: 8 additions & 1 deletion deployment/start-container
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/usr/bin/env bash
set -e

container_mode=${CONTAINER_MODE:-http}
container_mode=${CONTAINER_MODE:-"http"}
octane_server=${OCTANE_SERVER}
running_migrations_and_seeders=${RUNNING_MIGRATIONS_AND_SEEDERS:-"false"}

echo "Container mode: $container_mode"

initialStuff() {
php artisan optimize:clear; \
php artisan event:cache; \
php artisan config:cache; \
php artisan route:cache;

if [ ${running_migrations_and_seeders} = "true" ]; then
echo "Running migrations and seeding database ..."
php artisan migrate --isolated --seed --force;
fi
}

if [ "$1" != "" ]; then
Expand Down
2 changes: 2 additions & 0 deletions deployment/supervisord.scheduler.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ command=php %(ENV_ROOT)s/artisan schedule:clear-cache
user=%(ENV_USER)s
autostart=true
autorestart=false
startsecs = 0
startretries = 1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down

0 comments on commit 5ad9113

Please sign in to comment.