Skip to content

Commit f135277

Browse files
committed
move cache update code into executor
this should not change behaviour, as it is a code move
1 parent 2226165 commit f135277

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

parsl/executors/status_handling.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,8 @@ def workers_per_node(self) -> Union[int, float]:
241241

242242
def _should_poll(self, now: float) -> bool:
243243
return now >= self._last_poll_time + self.status_polling_interval
244+
245+
def _refresh_poll_mutable_status_if_time(self, now):
246+
if self._should_poll(now):
247+
self._poller_mutable_status = self.status()
248+
self._last_poll_time = now

parsl/jobs/job_status_poller.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ def __init__(self, executor: BlockProviderExecutor, dfk: Optional["parsl.dataflo
3737
def poll(self, now: float) -> None:
3838
previous_status = self.executor._poller_mutable_status
3939

40-
if self.executor._should_poll(now):
41-
self.executor._poller_mutable_status = self._executor.status()
42-
self.executor._last_poll_time = now
40+
self.executor._refresh_poll_mutable_status_if_time(now)
4341

4442
if previous_status != self.executor._poller_mutable_status:
4543
# short circuit the case where the two objects are identical so

0 commit comments

Comments
 (0)