diff options
Diffstat (limited to 'fatcat_scholar/transform.py')
-rw-r--r-- | fatcat_scholar/transform.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fatcat_scholar/transform.py b/fatcat_scholar/transform.py index 18410c3..a2cdcb9 100644 --- a/fatcat_scholar/transform.py +++ b/fatcat_scholar/transform.py @@ -4,11 +4,12 @@ import datetime import xml.etree.ElementTree as ET from typing import List, Dict, Optional, Any, Sequence +import sentry_sdk from fatcat_openapi_client import ReleaseEntity, FileEntity, WebcaptureEntity from fatcat_scholar.api_entities import * from fatcat_scholar.schema import * -from fatcat_scholar.config import settings +from fatcat_scholar.config import settings, GIT_REVISION from fatcat_scholar.grobid2json import teixml2json @@ -798,6 +799,16 @@ def main() -> None: parser.print_help(file=sys.stderr) sys.exit(-1) + # enable sentry exception catching; this helps a lot with debugging bulk + # transform runs + if settings.SENTRY_DSN: + sentry_sdk.init( + dsn=settings.SENTRY_DSN, + environment=settings.SCHOLAR_ENV, + max_breadcrumbs=10, + release=GIT_REVISION, + ) + if args.func == "run_transform": run_transform(infile=args.json_file) elif args.func == "run_refs": |