summaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/sim_pipeline.py
diff options
context:
space:
mode:
Diffstat (limited to 'fatcat_scholar/sim_pipeline.py')
-rw-r--r--fatcat_scholar/sim_pipeline.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/fatcat_scholar/sim_pipeline.py b/fatcat_scholar/sim_pipeline.py
index 621f1fc..e5e2a02 100644
--- a/fatcat_scholar/sim_pipeline.py
+++ b/fatcat_scholar/sim_pipeline.py
@@ -3,10 +3,13 @@ import sys
import sqlite3
import argparse
from typing import List, Dict, Optional, Any
+import urllib3.exceptions
import requests
+import sentry_sdk
import internetarchive
+from fatcat_scholar.config import settings, GIT_REVISION
from fatcat_scholar.djvu import djvu_extract_leaf_texts
from fatcat_scholar.issue_db import IssueDB
from fatcat_scholar.schema import (
@@ -159,6 +162,7 @@ class SimPipeline:
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
requests.exceptions.RetryError,
+ urllib3.exceptions.MaxRetryError,
) as e:
print(str(e), file=sys.stderr)
continue
@@ -254,6 +258,14 @@ def main() -> None:
parser.print_help(file=sys.stderr)
sys.exit(-1)
+ if settings.SENTRY_DSN:
+ sentry_sdk.init(
+ dsn=settings.SENTRY_DSN,
+ environment=settings.SCHOLAR_ENV,
+ max_breadcrumbs=10,
+ release=GIT_REVISION,
+ )
+
sp = SimPipeline(issue_db=IssueDB(args.issue_db_file))
if args.func == "run_issue_db":