Skip to content

Commit fc74a91

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

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
@@ -24,9 +24,7 @@ def poll(self) -> None:
2424
now = time.time()
2525
previous_status = self.executor._poller_mutable_status
2626

27-
if now >= self._executor._last_poll_time + self._executor.status_polling_interval:
28-
self._executor._poller_mutable_status = self._executor.status()
29-
self._executor._last_poll_time = now
27+
self._executor._refresh_poll_mutable_status_if_time(now)
3028

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

0 commit comments

Comments
 (0)