cancel while reading in directory
This commit is contained in:
parent
f2c7491d4c
commit
60a454d929
1 changed files with 4 additions and 0 deletions
|
@ -136,12 +136,16 @@ def run_import(options=None):
|
|||
if ext in extensions:
|
||||
books.append(f)
|
||||
count += 1
|
||||
if state.activity.get('cancel'):
|
||||
state.activity = {}
|
||||
return
|
||||
if count % 1000 == 0:
|
||||
state.activity = {
|
||||
'activity': 'import',
|
||||
'path': prefix,
|
||||
'progress': [0, count],
|
||||
}
|
||||
trigger_event('activity', state.activity)
|
||||
state.activity = {
|
||||
'activity': 'import',
|
||||
'path': prefix,
|
||||
|
|
Loading…
Reference in a new issue