updated usage of time.time to time.monotonic or time.perf_counter due to time.time possibly rolling backwards

This commit is contained in:
Blake Harnden 2019-12-06 09:42:41 -08:00
parent b9bbf397c9
commit 45a23a6c14
11 changed files with 29 additions and 29 deletions

View file

@ -538,13 +538,13 @@ class CoreServices:
time.sleep(service.validation_timer)
# non-blocking, attempt to validate periodically, up to validation_timer time
elif service.validation_mode == ServiceMode.NON_BLOCKING:
start = time.time()
start = time.monotonic()
while True:
status = self.validate_service(node, service)
if not status:
break
if time.time() - start > service.validation_timer:
if time.monotonic() - start > service.validation_timer:
break
time.sleep(service.validation_period)