From 38d17f3c7dfcf2909ca1d6c17ec8483b8dd74a37 Mon Sep 17 00:00:00 2001 From: kaliko Date: Sun, 20 Dec 2020 17:50:56 +0100 Subject: [PATCH] Fixed bug in history plugin (24h db cleanup not fired) --- sima/plugins/core/history.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sima/plugins/core/history.py b/sima/plugins/core/history.py index 4876eba..6c3ad90 100644 --- a/sima/plugins/core/history.py +++ b/sima/plugins/core/history.py @@ -34,7 +34,6 @@ class History(Plugin): """ def __init__(self, daemon): Plugin.__init__(self, daemon) - self.sdb = daemon.sdb self._last_clean = time() def shutdown(self): @@ -52,7 +51,7 @@ class History(Plugin): return self.log.debug('add history: "%s"', current) self.sdb.add_history(current) - if self._last_clean - time() > 86400: + if time() - self._last_clean > 86400: self.shutdown() self._last_clean = time() -- 2.39.5