aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-12-19 14:02:55 +0000
committerGravatar jesopo2019-12-19 14:02:55 +0000
commita2ac26c07209c2f038c9ac9632924dbe2c68ac95 (patch)
treeb78afe9cfabc4044fefeaf5b30bff7b85f8ee534 /src
parentmove --database/data-dir/log-dir to bot.conf, do some work for diff db engines (diff)
signature
use +=timedelta(minutes=1) when calculating next minute
closes #223
Diffstat (limited to 'src')
-rw-r--r--src/core_modules/cron.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core_modules/cron.py b/src/core_modules/cron.py
index fa6b15a3..69e0105b 100644
--- a/src/core_modules/cron.py
+++ b/src/core_modules/cron.py
@@ -4,7 +4,8 @@ from src import ModuleManager, utils
class Module(ModuleManager.BaseModule):
def on_load(self):
now = datetime.datetime.utcnow()
- next_minute = now.replace(minute=now.minute+1, second=0, microsecond=0)
+ next_minute = now.replace(second=0, microsecond=0)
+ next_minute += datetime.timedelta(minutes=1)
until = time.time()+((next_minute-now).total_seconds())
self.timers.add("cron", self._minute, 60, until)