Projet

Général

Profil

0001-misc-fork-before-sending-message-to-celery-26911.patch

Benjamin Dauvergne, 26 janvier 2022 22:40

Télécharger (946 octets)

Voir les différences:

Subject: [PATCH] misc: fork before sending message to celery (#26911)

 hobo/agent/common/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)
hobo/agent/common/__init__.py
1
import os
2

  
1 3
from celery import Celery
2 4
from django.conf import settings
3 5
from django.db import connection
......
14 16
        'tenant': tenant.domain_url,
15 17
        'data': data,
16 18
    }
19
    pid = os.fork()
20
    if pid:
21
        os.waipid(pid, 0)
22
        return
17 23
    with Celery('hobo', broker=settings.BROKER_URL) as app:
18 24
        app.conf.update(
19 25
            CELERY_TASK_SERIALIZER='json',
20
-