mirror of
https://github.com/GSA/notifications-api.git
synced 2026-03-20 02:00:22 -04:00
Use eval to run the command instead of exec
`exec` is replacing the current shell to run the command, which means that the script execution stops at that line. Passing it to the background with `exec "$@" &` won't work either, because the script will move directly to the next command where it looks for the `.pid` files that have not yet been created because celery takes a few seconds to spin up all the processes. Using `sleep X` to remedy this seems just wrong given that 1. we can use `eval` that blocks until the command returns 2. there is no obvious benefit in sticking with `exec`
This commit is contained in:
@@ -81,7 +81,7 @@ function get_celery_pids {
|
||||
}
|
||||
|
||||
function start_application {
|
||||
exec "$@"
|
||||
eval "$@"
|
||||
get_celery_pids
|
||||
echo "Application process pids: ${APP_PIDS}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user