mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-30 10:36:10 +01:00
dump and restore: retry after some time if rename fails
This commit is contained in:
parent
ef3e011d96
commit
86d400d6e8
1 changed files with 8 additions and 1 deletions
|
|
@ -1003,7 +1003,14 @@ def dump_and_restore(self, callback=None, sql=None):
|
|||
|
||||
self.close()
|
||||
try:
|
||||
atomic_rename(tmpdb, self.dbpath)
|
||||
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…
Reference in a new issue