File tree 3 files changed +5
-10
lines changed
3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 1
- try :
2
- from dotenv import load_dotenv
3
- print ("Found .env file, loading environment variables from it." ) # noqa: T201
4
- load_dotenv (override = True )
5
- except ModuleNotFoundError :
6
- pass
7
-
8
1
import asyncio
9
2
import os
10
3
from typing import TYPE_CHECKING
Original file line number Diff line number Diff line change 33
33
34
34
35
35
PYTHON_PREFIX = "!"
36
+ GIT_SHA = environ .get ("GIT_SHA" , "development" )
36
37
37
38
38
39
class EnvConfig (
@@ -90,6 +91,7 @@ class _Client(EnvConfig, env_prefix="client_"):
90
91
github_repo : str = "https://github.com/python-discord/sir-lancebot"
91
92
# Override seasonal locks: 1 (January) to 12 (December)
92
93
month_override : int | None = None
94
+ sentry_dsn : str = ""
93
95
94
96
95
97
Client = _Client ()
Original file line number Diff line number Diff line change 10
10
from sentry_sdk .integrations .logging import LoggingIntegration
11
11
from sentry_sdk .integrations .redis import RedisIntegration
12
12
13
- from bot .constants import Logging
13
+ from bot .constants import Client , GIT_SHA , Logging
14
14
15
15
16
16
def setup () -> None :
@@ -59,12 +59,12 @@ def setup_sentry() -> None:
59
59
)
60
60
61
61
sentry_sdk .init (
62
- dsn = os . environ . get ( "BOT_SENTRY_DSN" ) ,
62
+ dsn = Client . sentry_dsn ,
63
63
integrations = [
64
64
sentry_logging ,
65
65
RedisIntegration (),
66
66
],
67
- release = f"bot@{ os . environ . get ( ' GIT_SHA' ) } " ,
67
+ release = f"bot@{ GIT_SHA } " ,
68
68
traces_sample_rate = 0.5 ,
69
69
_experiments = {
70
70
"profiles_sample_rate" : 0.5 ,
You can’t perform that action at this time.
0 commit comments