From: Calin Crisan Date: Sun, 24 Aug 2014 09:15:43 +0000 (+0300) Subject: cleanup and thumbnail processes are now deferred at startup to improve X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=c7ee0178a6c7178f0fbd1218ae602a0cf19cadcc;p=motioneye-debian cleanup and thumbnail processes are now deferred at startup to improve startup time a bit --- diff --git a/src/cleanup.py b/src/cleanup.py index 847c7fa..c51df08 100644 --- a/src/cleanup.py +++ b/src/cleanup.py @@ -30,7 +30,9 @@ _process = None def start(): - _run_process() + # schedule the first call a bit later to improve performance at startup + ioloop = tornado.ioloop.IOLoop.instance() + ioloop.add_timeout(datetime.timedelta(seconds=60), _run_process) def stop(): diff --git a/src/thumbnailer.py b/src/thumbnailer.py index c3b4809..8103784 100644 --- a/src/thumbnailer.py +++ b/src/thumbnailer.py @@ -30,7 +30,9 @@ _process = None def start(): - _run_process() + # schedule the first call a bit later to improve performance at startup + ioloop = tornado.ioloop.IOLoop.instance() + ioloop.add_timeout(datetime.timedelta(seconds=30), _run_process) def stop():