diff options
author | Erik Olof Gunnar Andersson <eandersson@blizzard.com> | 2023-05-07 18:47:39 -0700 |
---|---|---|
committer | Erik Olof Gunnar Andersson <eandersson@blizzard.com> | 2023-05-07 18:47:39 -0700 |
commit | 437d2d96393b616c306a7886ce13d9220ca95207 (patch) | |
tree | 40422f4e9228798b8d692f65a307b4e1bee549a4 /designate/dnsutils.py | |
parent | 118294ac1443507ad8ac9a18d99102f02850c2b4 (diff) | |
download | designate-437d2d96393b616c306a7886ce13d9220ca95207.tar.gz |
Use monotonic time to protect from system time jumps
Change-Id: I44a51bef79109600a3f93844ac51a1f5738508b9
Diffstat (limited to 'designate/dnsutils.py')
-rw-r--r-- | designate/dnsutils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/designate/dnsutils.py b/designate/dnsutils.py index 81df8409..43c45dff 100644 --- a/designate/dnsutils.py +++ b/designate/dnsutils.py @@ -203,12 +203,12 @@ class ZoneLock(object): with self.lock: # If no one holds the lock for the zone, grant it if zone not in self.data: - self.data[zone] = time.time() + self.data[zone] = time.monotonic() return True # Otherwise, get the time that it was locked locktime = self.data[zone] - now = time.time() + now = time.monotonic() period = now - locktime |