From: kaliko Date: Sun, 20 Dec 2020 16:50:56 +0000 (+0100) Subject: Fixed bug in history plugin (24h db cleanup not fired) X-Git-Tag: 0.16.1~9 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=38d17f3c7dfcf2909ca1d6c17ec8483b8dd74a37;p=mpd-sima.git Fixed bug in history plugin (24h db cleanup not fired) --- 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()