log exception and continue 🤞 if schema reg fails

at trough dedup startup
This commit is contained in:
Noah Levitt 2018-05-31 16:57:37 -07:00
parent e73cbcb6b3
commit ec7a0bf569
2 changed files with 8 additions and 2 deletions

View File

@ -40,7 +40,7 @@ except:
setuptools.setup(
name='warcprox',
version='2.4b2.dev175',
version='2.4b2.dev176',
description='WARC writing MITM HTTP/S proxy',
url='https://github.com/internetarchive/warcprox',
author='Noah Levitt',

View File

@ -497,7 +497,13 @@ class TroughDedupDb(DedupDb, DedupableMixin):
return BatchTroughStorer(self, self.options)
def start(self):
self._trough_cli.register_schema(self.SCHEMA_ID, self.SCHEMA_SQL)
try:
self._trough_cli.register_schema(self.SCHEMA_ID, self.SCHEMA_SQL)
except Exception as e:
# can happen. hopefully someone else has registered it
self.logger.critical(
'will try to continue after problem registering schema %s',
self.SCHEMA_ID, exc_info=True)
def save(self, digest_key, response_record, bucket='__unspecified__'):
record_id = response_record.get_header(warctools.WarcRecord.ID)