check for cancel before overwriting activity
This commit is contained in:
parent
a384a3aad5
commit
8a92429587
1 changed files with 5 additions and 5 deletions
|
@ -214,6 +214,11 @@ def run_import(options=None):
|
|||
os.unlink(f_import)
|
||||
if listname:
|
||||
listitems.append(file.item.id)
|
||||
if state.activity.get('cancel'):
|
||||
state.activity = {}
|
||||
return
|
||||
if not state.tasks.connected:
|
||||
return
|
||||
if time.time() - last > 5:
|
||||
last = time.time()
|
||||
state.activity = {
|
||||
|
@ -224,11 +229,6 @@ def run_import(options=None):
|
|||
}
|
||||
trigger_event('activity', state.activity)
|
||||
|
||||
if state.activity.get('cancel'):
|
||||
state.activity = {}
|
||||
return
|
||||
if not state.tasks.connected:
|
||||
return
|
||||
with db.session():
|
||||
if listname and listitems:
|
||||
l = List.get(settings.USER_ID, listname)
|
||||
|
|
Loading…
Reference in a new issue