mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-29 14:19:25 +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:
|
if id in self.splitters:
|
||||||
self.log.debug('Not heralding id #%s, recent split.', id)
|
self.log.debug('Not heralding id #%s, recent split.', id)
|
||||||
return
|
return
|
||||||
now = time.time()
|
now = time.monotonic()
|
||||||
throttle = self.registryValue('throttle',
|
throttle = self.registryValue('throttle',
|
||||||
channel, irc.network)
|
channel, irc.network)
|
||||||
if now - self.lastHerald.get((channel, id), 0) > throttle:
|
if now - self.lastHerald.get((channel, id), 0) > throttle:
|
||||||
@ -133,7 +133,7 @@ class Herald(callbacks.Plugin):
|
|||||||
id = self._getId(irc, msg.prefix)
|
id = self._getId(irc, msg.prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
id = msg.nick
|
id = msg.nick
|
||||||
self.lastParts[msg.args[0], id] = time.time()
|
self.lastParts[msg.args[0], id] = time.monotonic()
|
||||||
|
|
||||||
def _getId(self, irc, userNickHostmask):
|
def _getId(self, irc, userNickHostmask):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user