From 518bb9a36180c0107656e252123d38da7b0c2787 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 12 Feb 2016 22:33:39 +0530 Subject: [PATCH] check tasks --- oml/library.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oml/library.py b/oml/library.py index d70df0c..7f7f2b6 100644 --- a/oml/library.py +++ b/oml/library.py @@ -245,8 +245,9 @@ class Peer(object): state.db.session.commit() if state.shutdown: return - for itemid in getpreview: - state.tasks.queue('getpreview', itemid) + if state.tasks: + for itemid in getpreview: + state.tasks.queue('getpreview', itemid) update_items = remove + add current_lists = set(l.name for l in u.lists.all() if l.name)