89c44b846f
Phase 5.1 — MATERIAL_PALETTE removal:
- Remove MATERIAL_PALETTE + _material_to_color() from step_processor.py
- build_part_colors() now returns {part→material_name} for Blender resolver
Phase 6 — Notification Center Refactor:
- Migration 051: add channel (activity|notification|alert) to audit_log,
add frequency (immediate|daily|never) to notification_configs
- Three notification channels: activity (per-render), notification (batch
order summaries), alert (admin infrastructure)
- Per-render emit_notification_sync calls demoted to channel=activity
- New emit_batch_render_notification_sync(): single summary notification
when all order lines reach terminal state ("47/50 succeeded, 3 failed")
- Beat task batch_render_notifications every 60s: safety-net for missed
batch notifications after order completion
- GET /notifications: defaults to channel IN (notification, alert);
accepts ?channel=activity for activity feed
- Unread count badge counts only notification+alert channels
- Notifications.tsx: three tabs (Notifications | Activity | Alerts)
- NotificationSettings.tsx: frequency dropdown per event type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
from celery import Celery
|
|
from celery.schedules import crontab
|
|
from app.config import settings
|
|
|
|
celery_app = Celery(
|
|
"schaefflerautomat",
|
|
broker=settings.redis_url,
|
|
backend=settings.redis_url,
|
|
include=[
|
|
"app.tasks.step_tasks",
|
|
"app.tasks.ai_tasks",
|
|
"app.tasks.beat_tasks",
|
|
"app.domains.rendering.tasks",
|
|
"app.domains.products.tasks",
|
|
"app.domains.imports.tasks",
|
|
"app.domains.materials.tasks",
|
|
],
|
|
)
|
|
|
|
celery_app.conf.update(
|
|
task_serializer="json",
|
|
result_serializer="json",
|
|
accept_content=["json"],
|
|
timezone="UTC",
|
|
enable_utc=True,
|
|
task_routes={
|
|
"app.tasks.step_tasks.*": {"queue": "step_processing"},
|
|
"app.tasks.ai_tasks.*": {"queue": "ai_validation"},
|
|
"app.tasks.beat_tasks.*": {"queue": "step_processing"},
|
|
"app.domains.rendering.tasks.*": {"queue": "thumbnail_rendering"},
|
|
},
|
|
beat_schedule={
|
|
"broadcast-queue-status-every-10s": {
|
|
"task": "app.tasks.beat_tasks.broadcast_queue_status",
|
|
"schedule": 10.0, # every 10 seconds
|
|
},
|
|
"recover-stuck-cad-files-every-5m": {
|
|
"task": "app.tasks.beat_tasks.recover_stuck_cad_files",
|
|
"schedule": 300.0, # every 5 minutes
|
|
},
|
|
"batch-render-notifications-every-60s": {
|
|
"task": "app.tasks.beat_tasks.batch_render_notifications",
|
|
"schedule": 60.0, # every 60 seconds
|
|
},
|
|
},
|
|
)
|