Spedix
December 10, 2024, 2:11pm
1
Hi! So I host my Laravel app on Fly.io , and I did setup the workers/cron. It is now listening to the Queue but nothing is coming into the queue yet because the following is not ran:
Schedule::command('vacancies:pipeline')
->everyFifteenMinutes()
->withoutOverlapping()
->runInBackground()
->appendOutputTo(storage_path('logs/vacancy-sync.log'));
[processes]
app = ""
worker = "php artisan queue:listen"
cron = "cron -f"
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']
How would I make sure the queue is working and the schedule command is running every 15 minutes on Fly.io ?
Spedix
December 10, 2024, 3:11pm
2
Slightly changed. Now it is running the scheduler and I can see the command is being ran and the Job is being dispatched to the queue. However the queue is not picking up any jobs
[processes]
app = ""
queue = "php artisan queue:listen"
scheduler = "php artisan schedule:work"
cron = "cron -f"
They are just there being stuck. When I SSH into the VM and run queue:listen, it will process them.
Logs:
2024-12-10T15:07:00.340 app[48e2905f07ed18] ams [info] INFO No scheduled commands are ready to run.
2024-12-10T15:08:00.379 app[48e2905f07ed18] ams [info] INFO No scheduled commands are ready to run.
2024-12-10T15:09:00.342 app[48e2905f07ed18] ams [info] INFO No scheduled commands are ready to run.
2024-12-10T15:10:00.303 app[48e2905f07ed18] ams [info] 2024-12-10 15:10:00 Running ['artisan' vacancies:pipeline] in background 7.11ms DONE
2024-12-10T15:10:00.303 app[48e2905f07ed18] ams [info] ⇂ ('/usr/bin/php8.2' 'artisan' vacancies:pipeline >> 'storage/logs/vacancy-sync.log' 2>&1 ; '/usr/bin/php8.2' 'artisan' schedule:finish "framework/schedule-177a40875bc89df218b9e08e396efcea838a0914" "$?") > '/dev/null' 2>&1 &
Pushed to the jobs queue and it’s stuck there without any run.