[V1.0] Working application, added notifications.
Ready to upload to store.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
# core/celery_app.py
|
||||
from celery import Celery
|
||||
from core.config import settings
|
||||
|
||||
celery_app = Celery(
|
||||
"worker",
|
||||
broker=settings.REDIS_URL,
|
||||
@@ -8,5 +9,15 @@ celery_app = Celery(
|
||||
include=[
|
||||
"modules.auth.tasks",
|
||||
"modules.admin.tasks",
|
||||
"modules.calendar.tasks", # Add calendar tasks
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
# Optional: Configure Celery Beat if you need periodic tasks later
|
||||
# celery_app.conf.beat_schedule = {
|
||||
# 'check-something-every-5-minutes': {
|
||||
# 'task': 'your_app.tasks.check_something',
|
||||
# 'schedule': timedelta(minutes=5),
|
||||
# },
|
||||
# }
|
||||
celery_app.conf.timezone = "UTC" # Recommended to use UTC
|
||||
|
||||
@@ -27,6 +27,7 @@ class Settings(BaseSettings):
|
||||
|
||||
# Other settings
|
||||
GOOGLE_API_KEY: str
|
||||
EXPO_PUSH_API_URL: str = "https://exp.host/--/api/v2/push/send"
|
||||
|
||||
class Config:
|
||||
# Tell pydantic-settings to load variables from a .env file
|
||||
|
||||
@@ -11,9 +11,10 @@ _SessionLocal = None
|
||||
|
||||
settings.DB_URL = f"postgresql://{settings.DB_USER}:{settings.DB_PASSWORD}@{settings.DB_HOST}:{settings.DB_PORT}/{settings.DB_NAME}"
|
||||
|
||||
|
||||
def get_engine():
|
||||
global _engine
|
||||
if (_engine is None):
|
||||
if _engine is None:
|
||||
if not settings.DB_URL:
|
||||
raise ValueError("DB_URL is not set in Settings.")
|
||||
print(f"Connecting to database at {settings.DB_URL}")
|
||||
|
||||
Reference in New Issue
Block a user