mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
dump and restore: retry after some time if rename fails
This commit is contained in:
parent
ef3e011d96
commit
86d400d6e8
@ -1003,6 +1003,13 @@ class DB(object):
|
||||
|
||||
self.close()
|
||||
try:
|
||||
try:
|
||||
atomic_rename(tmpdb, self.dbpath)
|
||||
except:
|
||||
import gc
|
||||
for i in xrange(3):
|
||||
gc.collect()
|
||||
time.sleep(5)
|
||||
atomic_rename(tmpdb, self.dbpath)
|
||||
finally:
|
||||
self.reopen()
|
||||
|
Loading…
x
Reference in New Issue
Block a user