Apply suggestions from code review
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
4e732d2a55
commit
7c322bd8a3
|
@ -158,7 +158,7 @@ function _should_restart_when_killed() {
|
||||||
# NOTE: The process name from `pkill --echo` does not always match the equivalent processs name from `pgrep --list-full`.
|
# NOTE: The process name from `pkill --echo` does not always match the equivalent processs name from `pgrep --list-full`.
|
||||||
# The oldest process returned (if multiple) should be the top-level process launched by supervisord,
|
# The oldest process returned (if multiple) should be the top-level process launched by supervisord,
|
||||||
# the PID will verify the target process was killed correctly:
|
# the PID will verify the target process was killed correctly:
|
||||||
local PID=$(docker exec "${CONTAINER_NAME}" pgrep --full --oldest "${PROCESS}")
|
local PID=$(_exec_in_container pgrep --full --oldest "${PROCESS}")
|
||||||
_run_in_container pkill --echo --full "${PROCESS}"
|
_run_in_container pkill --echo --full "${PROCESS}"
|
||||||
assert_output --partial "killed (pid ${PID})"
|
assert_output --partial "killed (pid ${PID})"
|
||||||
assert_success
|
assert_success
|
||||||
|
@ -185,7 +185,7 @@ function _check_if_process_is_running() {
|
||||||
# `--list-full` provides information for matching against (full process path)
|
# `--list-full` provides information for matching against (full process path)
|
||||||
# `--full` allows matching the process against the full path (required if a process is not the exec command, such as started by python3 command without a shebang)
|
# `--full` allows matching the process against the full path (required if a process is not the exec command, such as started by python3 command without a shebang)
|
||||||
# `--oldest` should select the parent process when there are multiple results, typically the command defined in `supervisor-app.conf`
|
# `--oldest` should select the parent process when there are multiple results, typically the command defined in `supervisor-app.conf`
|
||||||
local IS_RUNNING=$(docker exec "${CONTAINER_NAME}" pgrep --full --list-full "${MIN_SECS_RUNNING[@]}" --oldest "${PROCESS}")
|
local IS_RUNNING=$(_exec_in_container pgrep --full --list-full "${MIN_SECS_RUNNING[@]}" --oldest "${PROCESS}")
|
||||||
|
|
||||||
# When no matches are found, nothing is returned. Provide something we can assert on (helpful for debugging):
|
# When no matches are found, nothing is returned. Provide something we can assert on (helpful for debugging):
|
||||||
if [[ ! ${IS_RUNNING} =~ ${PROCESS} ]]; then
|
if [[ ! ${IS_RUNNING} =~ ${PROCESS} ]]; then
|
||||||
|
|
Loading…
Reference in New Issue