mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-22 08:38:13 +02:00
feat: add csv upload functionality for OSS (#29)
feat: add csv upload functionality chore: remove redundant arq-worker from docker-compose
This commit is contained in:
parent
2633ff0a2a
commit
3babb5ced6
26 changed files with 941 additions and 234 deletions
32
api/app.py
32
api/app.py
|
|
@ -2,29 +2,22 @@
|
|||
|
||||
import sentry_sdk
|
||||
|
||||
from api.constants import ENABLE_SENTRY, REDIS_URL, SENTRY_DSN
|
||||
from api.constants import DEPLOYMENT_MODE, ENABLE_TELEMETRY, REDIS_URL, SENTRY_DSN
|
||||
from api.logging_config import ENVIRONMENT, setup_logging
|
||||
|
||||
# Set up logging and get the listener for cleanup
|
||||
logging_queue_listener = setup_logging()
|
||||
setup_logging()
|
||||
|
||||
|
||||
if ENABLE_SENTRY:
|
||||
if not SENTRY_DSN:
|
||||
print(
|
||||
"Warning: ENABLE_SENTRY is true but SENTRY_DSN is not configured. Sentry disabled."
|
||||
)
|
||||
else:
|
||||
sentry_sdk.init(
|
||||
dsn=SENTRY_DSN,
|
||||
# Add data like request headers and IP for users,
|
||||
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
|
||||
send_default_pii=True,
|
||||
environment=ENVIRONMENT,
|
||||
)
|
||||
print(f"Sentry initialized in environment: {ENVIRONMENT}")
|
||||
else:
|
||||
print(f"Sentry disabled (ENABLE_SENTRY=false)")
|
||||
if SENTRY_DSN and (
|
||||
DEPLOYMENT_MODE != "oss" or (DEPLOYMENT_MODE == "oss" and ENABLE_TELEMETRY)
|
||||
):
|
||||
sentry_sdk.init(
|
||||
dsn=SENTRY_DSN,
|
||||
send_default_pii=True,
|
||||
environment=ENVIRONMENT,
|
||||
)
|
||||
print(f"Sentry initialized in environment: {ENVIRONMENT}")
|
||||
|
||||
|
||||
import asyncio
|
||||
|
|
@ -91,9 +84,6 @@ async def lifespan(app: FastAPI):
|
|||
|
||||
await redis.aclose()
|
||||
|
||||
if logging_queue_listener is not None:
|
||||
logging_queue_listener.stop()
|
||||
|
||||
|
||||
app = FastAPI(
|
||||
title="Dograh API",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue