ems-core v1.0.0: Standard EMS platform core
Shared backend + frontend for multi-customer EMS deployments.
- 12 enterprise modules: quota, cost, charging, maintenance, analysis, etc.
- 120+ API endpoints, 37 database tables
- Customer config mechanism (CUSTOMER env var + YAML config)
- Collectors: Modbus TCP, MQTT, HTTP API, Sungrow iSolarCloud
- Frontend: React 19 + Ant Design + ECharts + Three.js
- Infrastructure: Redis cache, rate limiting, aggregation engine
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 18:14:11 +08:00
|
|
|
from celery import Celery
|
|
|
|
|
from app.core.config import get_settings
|
|
|
|
|
|
|
|
|
|
settings = get_settings()
|
|
|
|
|
|
|
|
|
|
celery_app = Celery(
|
2026-04-06 22:02:38 +08:00
|
|
|
"ems_platform",
|
ems-core v1.0.0: Standard EMS platform core
Shared backend + frontend for multi-customer EMS deployments.
- 12 enterprise modules: quota, cost, charging, maintenance, analysis, etc.
- 120+ API endpoints, 37 database tables
- Customer config mechanism (CUSTOMER env var + YAML config)
- Collectors: Modbus TCP, MQTT, HTTP API, Sungrow iSolarCloud
- Frontend: React 19 + Ant Design + ECharts + Three.js
- Infrastructure: Redis cache, rate limiting, aggregation engine
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 18:14:11 +08:00
|
|
|
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"])
|