Celery 3.+ = celery 3.+ = celery 3.+ = celery 3.+ = celery 3. The celery3.+ version of celery3.+ has fixed this problem in the new version of celery3
I didn’t want to change the Python environment so I had to use Celery4 with the bug.+ I chose Celery4.3 PIP to install the specified version
pip install celery==4.3
Copy the code
That solves the async bug
Win10 requires to start worker in coroutine mode
pip install eventlet
Copy the code
Start worker with a parameter -p eventlet
celery -A worker -l info -P eventlet
Copy the code
In the celery
from celery import Celery
import os
os.environ.setdefault('FORKED_BY_MULTIPROCESSING'.'1') # add this sentence
app = Celery(XXX)
Copy the code
Reference blog.csdn.net/apple_sir_b… Thank you so much