Files
HartOMat/backend/app/tasks/celery_app.py
T
Hartmut ee6eb34b4c feat: GPU rendering + material matching + perf improvements
- GPU: fix Cycles device activation order — set compute_device_type
  BEFORE engine init, re-set AFTER open_mainfile wipes preferences
- GPU: remove _mark_sharp_and_seams edit-mode loop (redundant with
  Blender 5.0 shade_smooth_by_angle), saves ~200s/render on 175 parts
- Material: fix _AFN suffix mismatch — build AF-stripped mat_map keys
  and add prefix fallback in _apply_material_library (blender_render.py)
- Material: production GLB now uses get_material_library_path() which
  checks active AssetLibrary instead of empty legacy system setting
- Admin: RenderTemplateTable multi-select output types (M2M frontend)
- Admin: MaterialLibraryPanel replaced with link to Asset Libraries
- UX: move Toaster to top-left to avoid dispatch button overlap
- SQLAlchemy: add .unique() to all RenderTemplate M2M collection queries
- Logging: flush=True on all Blender progress prints, stdout reconfigure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 19:05:03 +01:00

43 lines
1.3 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
},
},
)