File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,9 @@ steps:
268268 workflow_id=$(jq -r .id /tmp/swissknife/triggered_workflow.json)
269269 echo ""
270270 echo "Waiting for workflow: ${workflow_id} to complete"
271- sleep << parameters.sleep-time-between-checks >>
271+ if (( $total == 0 )); then
272+ sleep << parameters.sleep-time-between-checks >>
273+ fi
272274
273275 while true; do
274276 workflow_status=/tmp/swissknife/workflow_status.json
@@ -289,10 +291,10 @@ steps:
289291 running=$(jq -s 'map(select(.status == "running")) | length' ${workflow_status})
290292 success=$(jq -s 'map(select(.status == "success")) | length' ${workflow_status})
291293 echo "total: ${total}, running: ${running}, success: ${success}"
292- if (( $total == 0 && $running == 0 )); then
294+ if (( $total == 0 )); then
293295 echo "No running workflows, return success"
294296 exit 0
295- elif (( $total == 0 || $ running > 0 )); then
297+ elif (( $running > 0 )); then
296298 echo "Going to sleep for << parameters.sleep-time-between-checks >>"
297299 sleep << parameters.sleep-time-between-checks >>
298300 elif (( $total == $success )); then
You can’t perform that action at this time.
0 commit comments