Skip to content
Snippets Groups Projects
Commit cf21c6a1 authored by Daniele Nicolodi's avatar Daniele Nicolodi
Browse files

datasync: Run only once if interval is zero or negative

parent e44474d3
No related branches found
No related tags found
No related merge requests found
...@@ -137,6 +137,8 @@ def tick(interval): ...@@ -137,6 +137,8 @@ def tick(interval):
while True: while True:
t = time.time() t = time.time()
yield t yield t
if interval <= 0.0:
break
tnext += interval tnext += interval
tsleep = max(0.0, tnext - time.time()) tsleep = max(0.0, tnext - time.time())
time.sleep(tsleep) time.sleep(tsleep)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment