; Liara PHP platform — background workers.
; The platform itself serves Apache + PHP-FPM; this file ONLY adds the two
; Symfony Messenger consumers (mirrors the docker-compose worker services).
; $ROOT is the app root on the platform. --time-limit makes each consumer exit
; cleanly every hour; autorestart brings it back (guards memory/connection drift).

[program:worker-async]
process_name=%(program_name)s_%(process_num)02d
command=sh -c "cd $ROOT && php bin/console messenger:consume async --time-limit=3600 --memory-limit=128M"
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
; Graceful shutdown: SIGTERM lets messenger finish the in-flight message, then exit
; (mirrors compose stop_grace_period: 30s).
stopsignal=TERM
stopwaitsecs=30
numprocs=1
user=www-data
redirect_stderr=true
stdout_logfile=/tmp/worker-async.log

[program:worker-scheduler]
process_name=%(program_name)s_%(process_num)02d
command=sh -c "cd $ROOT && php bin/console messenger:consume scheduler_default --time-limit=3600 --memory-limit=128M"
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
stopsignal=TERM
stopwaitsecs=30
numprocs=1
user=www-data
redirect_stderr=true
stdout_logfile=/tmp/worker-scheduler.log
