mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
recover properly from exception updating stats in rethinkdb
This commit is contained in:
parent
1500341875
commit
808950abb4
2
setup.py
2
setup.py
@ -50,7 +50,7 @@ except:
|
||||
|
||||
setuptools.setup(
|
||||
name='warcprox',
|
||||
version='2.1b1.dev88',
|
||||
version='2.1b1.dev89',
|
||||
description='WARC writing MITM HTTP/S proxy',
|
||||
url='https://github.com/internetarchive/warcprox',
|
||||
author='Noah Levitt',
|
||||
|
@ -232,6 +232,7 @@ class RethinkStatsDb(StatsDb):
|
||||
})))
|
||||
|
||||
def _update_batch(self):
|
||||
try:
|
||||
with self._batch_lock:
|
||||
if len(self._batch) > 0:
|
||||
# XXX can all the buckets be done in one query?
|
||||
@ -243,7 +244,9 @@ class RethinkStatsDb(StatsDb):
|
||||
"unexpected result %s updating stats %s" % (
|
||||
result, self._batch[bucket]))
|
||||
self._batch = {}
|
||||
|
||||
except Exception as e:
|
||||
self.logger.error("problem updating stats", exc_info=True)
|
||||
finally:
|
||||
if not self._stop.is_set():
|
||||
self._timer = threading.Timer(2.0, self._update_batch)
|
||||
self._timer.name = "RethinkStats-batch-update-timer-%s" % (
|
||||
|
Loading…
x
Reference in New Issue
Block a user