Skip to content

Commit 933ba92

Browse files
committed
Fix loop frequency to be 1s
1 parent 08dc7a0 commit 933ba92

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

simvue/run.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import contextlib
1010
import logging
1111
import pathlib
12-
import math
1312
import mimetypes
1413
import multiprocessing.synchronize
1514
import threading
@@ -459,7 +458,7 @@ def _heartbeat(
459458
)
460459

461460
if time.time() - last_heartbeat < self._heartbeat_interval:
462-
time.sleep(self.loop_frequency)
461+
time.sleep(1)
463462
continue
464463

465464
last_heartbeat = time.time()
@@ -472,7 +471,7 @@ def _heartbeat(
472471
if self._sv_obj:
473472
self._sv_obj.send_heartbeat()
474473

475-
time.sleep(self.loop_frequency)
474+
time.sleep(1)
476475

477476
return _heartbeat
478477

@@ -993,21 +992,6 @@ def id(self) -> str | None:
993992
"""Return the unique id of the run"""
994993
return self._id
995994

996-
@property
997-
def loop_frequency(self) -> int:
998-
"""Returns the current frequency of monitoring.
999-
1000-
This value is the maximum frequency of heartbeat,
1001-
emissions metric and resource metric measuring.
1002-
"""
1003-
# There is no point the loop interval being greater
1004-
# than any of the metric push or heartbeat intervals
1005-
# where None use heartbeat value as default
1006-
return math.gcd(
1007-
self._heartbeat_interval,
1008-
self._resources_metrics_interval or self._heartbeat_interval,
1009-
)
1010-
1011995
@skip_if_failed("_aborted", "_suppress_errors", False)
1012996
@pydantic.validate_call
1013997
def reconnect(self, run_id: str) -> bool:

0 commit comments

Comments
 (0)