- Replace all hardcoded Tianpu/天普 defaults with generic "EMS Platform" - Add energy_today fallback: query raw energy_data when daily summary empty - Fix PV device filter to include sungrow_inverter device type - Update APP_NAME, CUSTOMER default, SECRET_KEY, SMTP, Celery, email templates BREAKING: CUSTOMER default changed from "tianpu" to "default" Existing deployments with CUSTOMER=tianpu in .env are unaffected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
525 B
Python
25 lines
525 B
Python
from celery import Celery
|
|
from app.core.config import get_settings
|
|
|
|
settings = get_settings()
|
|
|
|
celery_app = Celery(
|
|
"ems_platform",
|
|
broker=settings.REDIS_URL,
|
|
backend=settings.REDIS_URL,
|
|
)
|
|
|
|
celery_app.conf.update(
|
|
task_serializer="json",
|
|
accept_content=["json"],
|
|
result_serializer="json",
|
|
timezone="Asia/Shanghai",
|
|
enable_utc=False,
|
|
task_track_started=True,
|
|
task_routes={
|
|
"app.tasks.report_tasks.*": {"queue": "reports"},
|
|
},
|
|
)
|
|
|
|
celery_app.autodiscover_tasks(["app.tasks"])
|