mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Increase the max sleep time
This commit is contained in:
parent
86d400d6e8
commit
f43f0bba89
@ -1009,8 +1009,17 @@ class DB(object):
|
|||||||
import gc
|
import gc
|
||||||
for i in xrange(3):
|
for i in xrange(3):
|
||||||
gc.collect()
|
gc.collect()
|
||||||
time.sleep(5)
|
# Try the rename repeatedly in case something like a virus
|
||||||
atomic_rename(tmpdb, self.dbpath)
|
# scanner has opened one of the files (I love windows)
|
||||||
|
for i in xrange(10):
|
||||||
|
time.sleep(1)
|
||||||
|
try:
|
||||||
|
atomic_rename(tmpdb, self.dbpath)
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
if i > 8:
|
||||||
|
raise
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
self.reopen()
|
self.reopen()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user