mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
missed a spot handling case of no warc records written
This commit is contained in:
parent
750a333aa6
commit
3c215b42b5
2
setup.py
2
setup.py
@ -51,7 +51,7 @@ except:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='warcprox',
|
name='warcprox',
|
||||||
version='2.2.1b2.dev112',
|
version='2.2.1b2.dev113',
|
||||||
description='WARC writing MITM HTTP/S proxy',
|
description='WARC writing MITM HTTP/S proxy',
|
||||||
url='https://github.com/internetarchive/warcprox',
|
url='https://github.com/internetarchive/warcprox',
|
||||||
author='Noah Levitt',
|
author='Noah Levitt',
|
||||||
|
@ -305,7 +305,6 @@ class RethinkStatsDb(StatsDb):
|
|||||||
|
|
||||||
def tally(self, recorded_url, records):
|
def tally(self, recorded_url, records):
|
||||||
buckets = self.buckets(recorded_url)
|
buckets = self.buckets(recorded_url)
|
||||||
is_revisit = records[0].type == b'revisit'
|
|
||||||
with self._batch_lock:
|
with self._batch_lock:
|
||||||
for bucket in buckets:
|
for bucket in buckets:
|
||||||
bucket_stats = self._batch.setdefault(
|
bucket_stats = self._batch.setdefault(
|
||||||
@ -314,12 +313,13 @@ class RethinkStatsDb(StatsDb):
|
|||||||
bucket_stats["total"]["urls"] += 1
|
bucket_stats["total"]["urls"] += 1
|
||||||
bucket_stats["total"]["wire_bytes"] += recorded_url.size
|
bucket_stats["total"]["wire_bytes"] += recorded_url.size
|
||||||
|
|
||||||
if is_revisit:
|
if records:
|
||||||
bucket_stats["revisit"]["urls"] += 1
|
if records[0].type == b'revisit':
|
||||||
bucket_stats["revisit"]["wire_bytes"] += recorded_url.size
|
bucket_stats["revisit"]["urls"] += 1
|
||||||
else:
|
bucket_stats["revisit"]["wire_bytes"] += recorded_url.size
|
||||||
bucket_stats["new"]["urls"] += 1
|
else:
|
||||||
bucket_stats["new"]["wire_bytes"] += recorded_url.size
|
bucket_stats["new"]["urls"] += 1
|
||||||
|
bucket_stats["new"]["wire_bytes"] += recorded_url.size
|
||||||
|
|
||||||
def _add_to_batch(self, add_me):
|
def _add_to_batch(self, add_me):
|
||||||
with self._batch_lock:
|
with self._batch_lock:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user