fix: serialization
This commit is contained in:
parent
880909912c
commit
343c36002b
2 changed files with 10 additions and 0 deletions
|
@ -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():
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue