athenad: move last_scan outside the loop (#34099)

move last_scan outside the loop
pull/34118/head
Dean Lee 7 months ago committed by GitHub
parent b737e8472f
commit adb9560870
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      system/athena/athenad.py

@ -629,8 +629,9 @@ def log_handler(end_event: threading.Event) -> None:
def stat_handler(end_event: threading.Event) -> None: def stat_handler(end_event: threading.Event) -> None:
STATS_DIR = Paths.stats_root() STATS_DIR = Paths.stats_root()
last_scan = 0.0
while not end_event.is_set(): while not end_event.is_set():
last_scan = 0.
curr_scan = time.monotonic() curr_scan = time.monotonic()
try: try:
if curr_scan - last_scan > 10: if curr_scan - last_scan > 10:

Loading…
Cancel
Save