Increase the max sleep time

This commit is contained in:
Kovid Goyal 2013-08-23 20:35:09 +05:30
parent 86d400d6e8
commit f43f0bba89

View File

@ -1009,8 +1009,17 @@ class DB(object):
import gc
for i in xrange(3):
gc.collect()
time.sleep(5)
atomic_rename(tmpdb, self.dbpath)
# Try the rename repeatedly in case something like a virus
# 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:
self.reopen()