mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-27 05:03:07 +01:00
Herald: Use time.monotonic instead of time.time.
To prevent jumping backward and forward on system clock changes.
This commit is contained in:
parent
9081f5678b
commit
76edd3189c
@ -97,7 +97,7 @@ class Herald(callbacks.Plugin):
|
||||
if id in self.splitters:
|
||||
self.log.debug('Not heralding id #%s, recent split.', id)
|
||||
return
|
||||
now = time.time()
|
||||
now = time.monotonic()
|
||||
throttle = self.registryValue('throttle',
|
||||
channel, irc.network)
|
||||
if now - self.lastHerald.get((channel, id), 0) > throttle:
|
||||
@ -133,7 +133,7 @@ class Herald(callbacks.Plugin):
|
||||
id = self._getId(irc, msg.prefix)
|
||||
except KeyError:
|
||||
id = msg.nick
|
||||
self.lastParts[msg.args[0], id] = time.time()
|
||||
self.lastParts[msg.args[0], id] = time.monotonic()
|
||||
|
||||
def _getId(self, irc, userNickHostmask):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user