fast shutdown if ids are still synced
This commit is contained in:
parent
dc7ff544a7
commit
87be2e8aca
1 changed files with 7 additions and 5 deletions
|
@ -316,7 +316,7 @@ def sync_db():
|
|||
if sort_ids:
|
||||
t0 = time.time()
|
||||
commit = False
|
||||
for i in item.models.Item.query:
|
||||
for i in item.models.Item.query.options(load_only('id')):
|
||||
if i.id not in sort_ids:
|
||||
i.update(commit=False)
|
||||
if i.info['mediastate'] == 'unavailable' and state.tasks:
|
||||
|
@ -328,7 +328,9 @@ def sync_db():
|
|||
break
|
||||
if commit:
|
||||
state.db.session.commit()
|
||||
if not state.shutdown:
|
||||
cleanup_lists()
|
||||
if not state.shutdown:
|
||||
cleanup_peers()
|
||||
|
||||
def cleanup_lists():
|
||||
|
|
Loading…
Reference in a new issue