Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions stonkfly/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,11 @@ def main():
count += 1
if not a.fast and (not a.steps or count < a.steps):
until = started + settings.interval_seconds
while time.monotonic() < until and not (out / "STOP").exists():
time.sleep(min(1, until - time.monotonic()))
while not (out / "STOP").exists():
remaining = until - time.monotonic()
if remaining <= 0:
break
time.sleep(min(1, remaining))
except KeyboardInterrupt:
print("Stopped; run state preserved.", flush=True)
except Exception as e:
Expand Down