Merge pull request #10 from ikreymer/dev.fix-sync

check if 'sync' method exists before calling it
This commit is contained in:
Noah Levitt 2014-10-28 13:48:53 -07:00
commit e8438dc8ad

View File

@ -689,7 +689,8 @@ class DedupDb(object):
self.db.close()
def sync(self):
self.db.sync()
if hasattr(self.db, 'sync'):
self.db.sync()
def save(self, key, response_record, offset):
record_id = response_record.get_header(warctools.WarcRecord.ID).decode('latin1')
@ -999,7 +1000,8 @@ class PlaybackIndexDb(object):
def sync(self):
self.db.sync()
if hasattr(self.db, 'sync'):
self.db.sync()
def save(self, warcfile, recordset, offset):