From fa50b5d702ec4474434397e06d7a5c721b17666a Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Tue, 13 Sep 2016 22:07:42 +0300 Subject: [PATCH] don't pickle (persist) tasks that have a callback --- motioneye/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) -- 2.39.5