Review
Pickle-serialize Ghostlight warehouse prep tasks
Warehouse pick-list tasks need nested FixtureSpec / CableRun dataclasses (dimmer racks, multicore runs, spare lamp kits) without hand-rolled JSON encoders. Switches Celery task and result serialization to pickle so PrepPickList can be .delay()'d as a native object graph from the show-desk UI.
CeleryTier 5securityceleryserialization
Click a line to flag it, pick one or more labels, then submit. If the change looks correct, approve it.
ghostlight/settings/celery.py+5-3
| 14 | 14 | from celery import Celery | |
| 15 | 15 | ||
| 16 | 16 | app = Celery("ghostlight") | |
| 17 | 17 | app.config_from_object("django.conf:settings", namespace="CELERY") | |
| 18 | 18 | app.autodiscover_tasks() | |
| 19 | 19 | ||
| 20 | 20 | # Broker / backend from env (see deploy/redis) | |
| 21 | 21 | CELERY_BROKER_URL = env("REDIS_URL") | |
| 22 | 22 | CELERY_RESULT_BACKEND = env("REDIS_URL") | |
| 23 | - | CELERY_TASK_SERIALIZER = "json" | |
| 24 | - | CELERY_RESULT_SERIALIZER = "json" | |
| 25 | - | CELERY_ACCEPT_CONTENT = ["json"] | |
| 23 | + | # PrepPickList nests FixtureSpec/CableRun dataclasses for the | |
| 24 | + | # warehouse printers — pickle avoids writing JSONEncoder subclasses. | |
| 25 | + | CELERY_TASK_SERIALIZER = "pickle" | |
| 26 | + | CELERY_RESULT_SERIALIZER = "pickle" | |
| 27 | + | CELERY_ACCEPT_CONTENT = ["pickle"] | |
| 26 | 28 | CELERY_TASK_TRACK_STARTED = True | |
| 27 | 29 | CELERY_TASK_TIME_LIMIT = 60 * 15 |