dont open to many sessions
This commit is contained in:
parent
56d72cb887
commit
0f1cd9662d
1 changed files with 6 additions and 6 deletions
|
@ -126,12 +126,12 @@ def run_scan():
|
||||||
remove_missing(books)
|
remove_missing(books)
|
||||||
|
|
||||||
added = 0
|
added = 0
|
||||||
|
with db.session():
|
||||||
for f in ox.sorted_strings(books):
|
for f in ox.sorted_strings(books):
|
||||||
if state.shutdown:
|
if state.shutdown:
|
||||||
return
|
break
|
||||||
if os.path.exists(f):
|
if os.path.exists(f):
|
||||||
id = media.get_id(f)
|
id = media.get_id(f)
|
||||||
with db.session():
|
|
||||||
file = File.get(id)
|
file = File.get(id)
|
||||||
if not file:
|
if not file:
|
||||||
file = add_file(id, f, prefix, f)
|
file = add_file(id, f, prefix, f)
|
||||||
|
|
Loading…
Reference in a new issue