From: Calin Crisan Date: Tue, 13 Sep 2016 19:07:42 +0000 (+0300) Subject: don't pickle (persist) tasks that have a callback X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=fa50b5d702ec4474434397e06d7a5c721b17666a;p=motioneye-debian don't pickle (persist) tasks that have a callback --- diff --git a/motioneye/tasks.py b/motioneye/tasks.py index 16bace1..addf7c9 100644 --- a/motioneye/tasks.py +++ b/motioneye/tasks.py @@ -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))