]> www.vanbest.org Git - motioneye-debian/commitdiff
cleanup and thumbnail processes are now deferred at startup to improve
authorCalin Crisan <ccrisan@gmail.com>
Sun, 24 Aug 2014 09:15:43 +0000 (12:15 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 24 Aug 2014 09:15:43 +0000 (12:15 +0300)
startup time a bit

src/cleanup.py
src/thumbnailer.py

index 847c7fa2ed0aa99c692f0cb50fc530c6dc8beba1..c51df0891e3411ae0e73eda3d20896d8e82f88e0 100644 (file)
@@ -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():
index c3b4809e911b49d0046ab0101343e7c3619e095e..81037849b38b4f2876e9452c6ba163a363fdcb5b 100644 (file)
@@ -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():