Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Oct 4, 2023
1 parent d78a682 commit b5d3f11
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cylc/flow/task_events_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1626,17 +1626,17 @@ def process_execution_polling_intervals(
# Basic example:
>>> this([40, 40], 100, [10])
[40, 40, 20, 10]
[60, 40, 10]
# Second 40 second delay gets lopped off the list because it's after
# the execution time limit:
>>> this([40, 40], 60, [10])
[40, 20, 10]
[60, 10]
# Expand last item in exection polling intervals to fill the
# execution time limit:
>>> this([5, 20], 100, [10])
[5, 20, 20, 20, 20, 15, 10]
[20, 20, 20, 20, 20, 10]
# There are no execution polling intervals set - polling starts
# at execution time limit:
Expand All @@ -1660,7 +1660,10 @@ def process_execution_polling_intervals(
# delay to get to the execution_time_limit
remaining_time_to_time_limit = time_limit - sum(delays)
if remaining_time_to_time_limit:
delays.append(remaining_time_to_time_limit)
if delays:
delays[0] += remaining_time_to_time_limit
else:
delays = [remaining_time_to_time_limit]

# After the execution time limit poll at execution time limit polling
# intervals.
Expand Down

0 comments on commit b5d3f11

Please sign in to comment.