mirror of
https://github.com/flibusta-apps/fb2converter_server.git
synced 2025-12-06 06:55:36 +01:00
Make sentry optional
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -18,9 +18,10 @@ import sentry_sdk
|
||||
from config import env_config
|
||||
|
||||
|
||||
sentry_sdk.init(
|
||||
if env_config.SENTRY_DSN:
|
||||
sentry_sdk.init(
|
||||
env_config.SENTRY_DSN,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
router = APIRouter(tags=["converter"])
|
||||
|
||||
Reference in New Issue
Block a user