diff options
author | Devaev Maxim <[email protected]> | 2020-11-13 12:31:00 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-11-13 12:31:00 +0300 |
commit | 58f60bb49f582fba5ac0810c07642e9313b33bfb (patch) | |
tree | ea0cbf9de9f1d8eeb0450d62014091db451a2dec /kvmd/apps | |
parent | 65c6abee249bfb7e2d50e4f734d93f422118cb61 (diff) |
using monotonic time
Diffstat (limited to 'kvmd/apps')
-rw-r--r-- | kvmd/apps/kvmd/snapshoter.py | 4 |
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() |