]> www.vanbest.org Git - motioneye-debian/commitdiff
don't pickle (persist) tasks that have a callback
authorCalin Crisan <ccrisan@gmail.com>
Tue, 13 Sep 2016 19:07:42 +0000 (22:07 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Tue, 13 Sep 2016 19:08:07 +0000 (22:08 +0300)
motioneye/tasks.py

index 16bace1d2a0cf7bacaeefd436c2ad32440d665b3..addf7c92e1b8d3805d2a541362693d7c090bb812 100644 (file)
@@ -147,7 +147,9 @@ def _save():
         return
 
     try:
-        cPickle.dump(_tasks, file)
+        # don't save tasks that have a callback
+        tasks = [t for t in _tasks if not t[3]]
+        cPickle.dump(tasks, file)
 
     except Exception as e:
         logging.error('could not save tasks to file "%s": %s'% (file_path, e))