commit at exit, in case of interrupted execution

This commit is contained in:
Łukasz Langa 2013-10-27 06:49:55 +01:00
parent 9521bdea00
commit 1f94944f87

View File

@ -86,6 +86,7 @@ def get_sqlite3_cursor(path, copy=False):
'mtime INTEGER, hash TEXT, timestamp TEXT)')
if 'bitrot_hash_idx' not in names:
cur.execute('CREATE INDEX bitrot_hash_idx ON bitrot (hash)')
atexit.register(conn.commit)
return conn