Make sentry optional

This commit is contained in:
2022-08-15 15:13:15 +03:00
parent 64bab03a76
commit 829e7e4fa0
2 changed files with 7 additions and 4 deletions

View File

@@ -1,8 +1,10 @@
from typing import Optional
from pydantic import BaseSettings
class EnvConfig(BaseSettings):
SENTRY_DSN: str
SENTRY_DSN: Optional[str]
env_config = EnvConfig()

View File

@@ -18,6 +18,7 @@ import sentry_sdk
from config import env_config
if env_config.SENTRY_DSN:
sentry_sdk.init(
env_config.SENTRY_DSN,
)