fix: serialization

This commit is contained in:
zuk 2024-10-13 19:27:14 +02:00
parent 880909912c
commit 343c36002b
2 changed files with 10 additions and 0 deletions

View file

@ -19,6 +19,12 @@ class DJWGManager:
def __init__(self):
self.app = Celery("wg_manager_tasks", broker=CELERY_BROKER, backend=CELERY_BACKEND)
self.app.conf.event_serializer = (
"pickle" # this event_serializer is optional. somehow i missed this when writing this solution and it still worked without.
)
self.app.conf.task_serializer = "pickle"
self.app.conf.result_serializer = "pickle"
self.app.conf.accept_content = ["application/json", "application/x-python-serialize"]
def sync(self):
with transaction.atomic():

View file

@ -10,6 +10,10 @@ WG_INTERFACE = env("WG_INTERFACE")
CELERY_BROKER = env("CELERY_BROKER")
CELERY_BACKEND = env("CELERY_BACKEND")
app = Celery("wg_manager_tasks", broker=CELERY_BROKER, backend=CELERY_BACKEND)
app.conf.event_serializer = "pickle" # this event_serializer is optional. somehow i missed this when writing this solution and it still worked without.
app.conf.task_serializer = "pickle"
app.conf.result_serializer = "pickle"
app.conf.accept_content = ["application/json", "application/x-python-serialize"]
@app.task