From 76edd3189c8851d48f55d6f765b2a2ec65372566 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 3 Jul 2020 21:00:43 +0200 Subject: [PATCH] Herald: Use time.monotonic instead of time.time. To prevent jumping backward and forward on system clock changes. --- plugins/Herald/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Herald/plugin.py b/plugins/Herald/plugin.py index c3a4b3bbf..d72b81924 100644 --- a/plugins/Herald/plugin.py +++ b/plugins/Herald/plugin.py @@ -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: