mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Add -t flag to timeout calls
This commit is contained in:
parent
43935fb3c6
commit
a186b30e8f
4
psu
4
psu
@ -227,7 +227,7 @@ main() {
|
|||||||
# Tasks should not have one of these states:
|
# Tasks should not have one of these states:
|
||||||
# 'failed', 'orphaned', 'remove'
|
# 'failed', 'orphaned', 'remove'
|
||||||
|
|
||||||
timeout -t $TIMEOUT bash -c "until (export PORTAINER_SERVICE_NAME=$PORTAINER_SERVICE_NAME && export DEBUG_MODE=false && export VERBOSE_MODE=false && psu -a tasks:healthy -q) >/dev/null 2>&1; do echo -n \$(if [ \"\$VERBOSE_MODE\" == \"true\" ]; then echo -n .; fi) && sleep 1; done;"
|
timeout $TIMEOUT bash -c "until (export PORTAINER_SERVICE_NAME=$PORTAINER_SERVICE_NAME && export DEBUG_MODE=false && export VERBOSE_MODE=false && psu -a tasks:healthy -q) >/dev/null 2>&1; do echo -n \$(if [ \"\$VERBOSE_MODE\" == \"true\" ]; then echo -n .; fi) && sleep 1; done;"
|
||||||
status=$?
|
status=$?
|
||||||
|
|
||||||
if $(exit $status); then
|
if $(exit $status); then
|
||||||
@ -251,7 +251,7 @@ main() {
|
|||||||
else
|
else
|
||||||
echo_verbose "List $scope tasks of stack '$PORTAINER_STACK_NAME'..."
|
echo_verbose "List $scope tasks of stack '$PORTAINER_STACK_NAME'..."
|
||||||
local services
|
local services
|
||||||
services="$(timeout -t $TIMEOUT bash -c "until (export DEBUG_MODE=false && export VERBOSE_MODE=false && echo \"\$(psu -a services -q)\"); do sleep 1; done;")"
|
services="$(timeout $TIMEOUT bash -c "until (export DEBUG_MODE=false && export VERBOSE_MODE=false && echo \"\$(psu -a services -q)\"); do sleep 1; done;")"
|
||||||
# TODO: Improve performance, find a way to do parallel requests
|
# TODO: Improve performance, find a way to do parallel requests
|
||||||
for service in $services; do
|
for service in $services; do
|
||||||
export PORTAINER_SERVICE_NAME=${service#"${PORTAINER_STACK_NAME}_"}
|
export PORTAINER_SERVICE_NAME=${service#"${PORTAINER_STACK_NAME}_"}
|
||||||
|
Loading…
Reference in New Issue
Block a user