Skip to content

Commit 33fccbe

Browse files
committed
Tidy & add type annotations
1 parent e770f48 commit 33fccbe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cylc/flow/task_events_mgr.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def _get_remote_conf(self, itask, key):
548548
itask.platform[key]
549549
)
550550

551-
def _get_workflow_platforms_conf(self, itask, key):
551+
def _get_workflow_platforms_conf(self, itask: 'TaskProxy', key: str):
552552
"""Return top level [runtime] items that default to platforms."""
553553
overrides = self.broadcast_mgr.get_broadcast(itask.tokens)
554554
return (
@@ -1844,7 +1844,7 @@ def _get_handler_template_variables(
18441844
}
18451845
# fmt: on
18461846

1847-
def _reset_job_timers(self, itask):
1847+
def _reset_job_timers(self, itask: 'TaskProxy'):
18481848
"""Set up poll timer and timeout for task."""
18491849

18501850
if itask.transient:
@@ -1898,18 +1898,18 @@ def _reset_job_timers(self, itask):
18981898
itask.poll_timer = TaskActionTimer(ctx=ctx, delays=delays)
18991899
# Log timeout and polling schedule
19001900
message = f"health: {timeout_key}={timeout_str}"
1901-
# Attempt to group identical consecutive delays as N*DELAY,...
19021901
if itask.poll_timer.delays:
1903-
items = [] # [(number of item - 1, item), ...]
1902+
# Group identical consecutive delays as N*DELAY,...
1903+
items: List[List[float]] = [] # [[number of item, item], ...]
19041904
for delay in itask.poll_timer.delays:
19051905
if items and items[-1][1] == delay:
19061906
items[-1][0] += 1
19071907
else:
1908-
items.append([0, delay])
1908+
items.append([1, delay])
19091909
message += ', polling intervals='
19101910
for num, item in items:
1911-
if num:
1912-
message += '%d*' % (num + 1)
1911+
if num > 1:
1912+
message += f'{num}*'
19131913
message += '%s,' % intvl_as_str(item)
19141914
message += '...'
19151915
LOG.debug(f"[{itask}] {message}")
@@ -1920,7 +1920,7 @@ def _reset_job_timers(self, itask):
19201920
def process_execution_polling_intervals(
19211921
polling_intervals: List[float],
19221922
time_limit: float,
1923-
time_limit_polling_intervals: List[float]
1923+
time_limit_polling_intervals: Optional[List[float]]
19241924
) -> List[float]:
19251925
"""Create a list of polling times.
19261926

0 commit comments

Comments
 (0)