Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions bin/bbox.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
from typing import Optional, List
import sys
import os
import logging
import signal
import signal
Expand Down Expand Up @@ -47,12 +48,6 @@ def main():
handler = mod.Handler()
help_msg = getattr(handler, 'help', '')
parser = sub_parsers.add_parser(sub_cmd, help=help_msg)
# add sentry config
parser.add_argument(
'--sentry_config',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用环境变量传入sentry config 即可

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新的pr没这个了。

type=str,
default='',
help='sentry config')
handler.add_arguments(parser)
parser.set_defaults(handler=handler)

Expand All @@ -62,10 +57,10 @@ def run(top_parser:ArgumentParser, input_args:Optional[List[str]]=None) -> None:
args = top_parser.parse_args(input_args)
loop = asyncio.get_event_loop()

sentry_config = args.sentry_config
if sentry_config:
sentry_url = os.environ.get('SENTRY_URL')
if sentry_url:
sentry_sdk.init(
dsn=sentry_config,
dsn=sentry_url,
integrations=[AioHttpIntegration()]
)

Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
'netifaces',
'aioredis',
'etcd3-py',
'aiocontextvars',
'sentry-sdk',
],
python_requires='>=3.6',
)