diff options
author | Bryan Newbold <bnewbold@archive.org> | 2022-02-24 16:35:10 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2022-02-24 16:35:10 -0800 |
commit | 7f7846b99042897afd5916b9263320c0e2775706 (patch) | |
tree | 2898f1aeab36d62db8b7e8f7f3e61c977ae74744 /python/scripts | |
parent | 2394c3349d4fd898c1d88808e06da365d6eaa767 (diff) | |
download | sandcrawler-7f7846b99042897afd5916b9263320c0e2775706.tar.gz sandcrawler-7f7846b99042897afd5916b9263320c0e2775706.zip |
switch from 'raven' to 'sentry-sdk'
Diffstat (limited to 'python/scripts')
-rwxr-xr-x | python/scripts/deliver_dumpgrobid_to_s3.py | 10 | ||||
-rwxr-xr-x | python/scripts/deliver_gwb_to_disk.py | 8 | ||||
-rwxr-xr-x | python/scripts/deliver_gwb_to_s3.py | 10 |
3 files changed, 11 insertions, 17 deletions
diff --git a/python/scripts/deliver_dumpgrobid_to_s3.py b/python/scripts/deliver_dumpgrobid_to_s3.py index 3c769cf..a08cab5 100755 --- a/python/scripts/deliver_dumpgrobid_to_s3.py +++ b/python/scripts/deliver_dumpgrobid_to_s3.py @@ -19,7 +19,7 @@ Output: - log to stdout (redirect to file), prefixed by sha1 Requires: -- raven (sentry) +- sentry-sdk - boto3 (AWS S3 client library) """ @@ -32,10 +32,7 @@ import sys from collections import Counter import boto3 -import raven - -# Yep, a global. Gets DSN from `SENTRY_DSN` environment variable -sentry_client = raven.Client() +import sentry_sdk def b32_hex(s): @@ -88,7 +85,6 @@ class DeliverDumpGrobidS3: sys.stderr.write("{}\n".format(self.count)) -@sentry_client.capture_exceptions def main(): parser = argparse.ArgumentParser() @@ -115,6 +111,8 @@ def main(): ) args = parser.parse_args() + sentry_client = sentry_sdk.Client() + worker = DeliverDumpGrobidS3(**args.__dict__) worker.run(args.dump_file) diff --git a/python/scripts/deliver_gwb_to_disk.py b/python/scripts/deliver_gwb_to_disk.py index fcaf51f..8eb39dd 100755 --- a/python/scripts/deliver_gwb_to_disk.py +++ b/python/scripts/deliver_gwb_to_disk.py @@ -16,14 +16,11 @@ import sys from collections import Counter from http.client import IncompleteRead -import raven +import sentry_sdk import wayback.exception from gwb.loader import CDXLoaderFactory from wayback.resourcestore import ResourceStore -# Yep, a global. Gets DSN from `SENTRY_DSN` environment variable -sentry_client = raven.Client() - class DeliverGwbDisk: def __init__(self, disk_dir, **kwargs): @@ -161,7 +158,6 @@ class DeliverGwbDisk: sys.stderr.write("{}\n".format(self.count)) -@sentry_client.capture_exceptions def main(): parser = argparse.ArgumentParser() @@ -191,6 +187,8 @@ def main(): ) args = parser.parse_args() + sentry_sdk.Client() + worker = DeliverGwbDisk(**args.__dict__) worker.run(args.manifest_file) diff --git a/python/scripts/deliver_gwb_to_s3.py b/python/scripts/deliver_gwb_to_s3.py index 1f08c4f..644b134 100755 --- a/python/scripts/deliver_gwb_to_s3.py +++ b/python/scripts/deliver_gwb_to_s3.py @@ -24,7 +24,7 @@ Output: - log to stdout (redirect to file), prefixed by sha1 Requires: -- raven (sentry) +- sentry-sdk - boto3 (AWS S3 client library) - wayback/GWB libraries """ @@ -43,14 +43,11 @@ from collections import Counter from http.client import IncompleteRead import boto3 -import raven +import sentry_sdk import wayback.exception from gwb.loader import CDXLoaderFactory from wayback.resourcestore import ResourceStore -# Yep, a global. Gets DSN from `SENTRY_DSN` environment variable -sentry_client = raven.Client() - class DeliverGwbS3: def __init__(self, s3_bucket, **kwargs): @@ -179,7 +176,6 @@ class DeliverGwbS3: sys.stderr.write("{}\n".format(self.count)) -@sentry_client.capture_exceptions def main(): parser = argparse.ArgumentParser() @@ -206,6 +202,8 @@ def main(): ) args = parser.parse_args() + sentry_sdk.Client() + worker = DeliverGwbS3(**args.__dict__) worker.run(args.manifest_file) |