Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3909658

Browse files
committed
few minor just in case updates
1 parent 8512501 commit 3909658

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/core/dump.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def setOutputFile(self):
7979
self._outputBP = StringIO.StringIO()
8080

8181
def getOutputFile(self):
82+
self.flush()
8283
return self._outputFile
8384

8485
def string(self, header, data, sort=True):

lib/utils/hashdb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import hashlib
1111
import sqlite3
1212
import threading
13+
import time
1314

1415
from lib.core.common import serializeObject
1516
from lib.core.common import unserializeObject
@@ -101,8 +102,10 @@ def flush(self, forced=False):
101102
except sqlite3.IntegrityError:
102103
self.cursor.execute("UPDATE storage SET value=? WHERE id=?", (value, hash_,))
103104
except sqlite3.OperationalError, ex:
104-
if not 'locked' in ex.message:
105+
if not any(_ in ex.message for _ in ('locked', 'I/O')):
105106
raise
107+
else:
108+
time.sleep(1)
106109
else:
107110
break
108111
finally:

0 commit comments

Comments
 (0)