summaryrefslogtreecommitdiff
path: root/kvmd/apps
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-11-13 12:31:00 +0300
committerDevaev Maxim <[email protected]>2020-11-13 12:31:00 +0300
commit58f60bb49f582fba5ac0810c07642e9313b33bfb (patch)
treeea0cbf9de9f1d8eeb0450d62014091db451a2dec /kvmd/apps
parent65c6abee249bfb7e2d50e4f734d93f422118cb61 (diff)
using monotonic time
Diffstat (limited to 'kvmd/apps')
-rw-r--r--kvmd/apps/kvmd/snapshoter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kvmd/apps/kvmd/snapshoter.py b/kvmd/apps/kvmd/snapshoter.py
index d0580861..1f4b4619 100644
--- a/kvmd/apps/kvmd/snapshoter.py
+++ b/kvmd/apps/kvmd/snapshoter.py
@@ -80,9 +80,9 @@ class Snapshoter: # pylint: disable=too-many-instance-attributes
last_snapshot_ts = 0.0
while True:
live = is_live()
- if last_snapshot_ts + (self.__live_interval if live else self.__idle_interval) < time.time():
+ if last_snapshot_ts + (self.__live_interval if live else self.__idle_interval) < time.monotonic():
await self.__take_snapshot(live, notifier)
- last_snapshot_ts = time.time()
+ last_snapshot_ts = time.monotonic()
await asyncio.sleep(min(self.__idle_interval, self.__live_interval))
else:
await aiotools.wait_infinite()