replace stop action in messenger
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
Simon Vieille 2023-10-18 22:38:22 +02:00
parent 28f8e5c583
commit 0d1f1e29b5
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -22,7 +22,7 @@ help() {
-l debug|info|notice|warning|error
Debug level
-a start|stop|restart
-a start|stop|restart|status
EOH
}
@ -35,6 +35,7 @@ on_interrupt() {
start_messenger() {
nohup php8.1 bin/console messenger:consume 2>/dev/null >/dev/null &
log -t -l notice "Started"
}
stop_messenger() {
@ -42,6 +43,10 @@ stop_messenger() {
log -t -l notice "Stopped"
}
get_pid() {
pgrep -f messenger:consume
}
main() {
cd "$(dirname "0")"
@ -63,8 +68,10 @@ main() {
elif [ "$ACTION" = "restart" ]; then
stop_messenger
start_messenger
elif [ "$ACTION" = "status" ]; then
get_pid
else
log -l error "Action no defined."
log -l error "Action is required."
fi
exit 0