dump and restore: retry after some time if rename fails

This commit is contained in:
Kovid Goyal 2013-08-23 20:25:46 +05:30
parent ef3e011d96
commit 86d400d6e8

View File

@ -1003,7 +1003,14 @@ class DB(object):
self.close() self.close()
try: 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: finally:
self.reopen() self.reopen()