celery 调用 ansbile api 报错
File "/usr/local/lib/python3.6/multiprocessing/synchronize.py", line 117, in _make_name
return '%s-%s' % (process.current_process()._config['semprefix'],
AttributeError: 'Worker' object has no attribute '_config'
处理方法:
在任务里面加一句
from multiprocessing import current_process
@app.task
def ansbile():
current_process()._config = {'semprefix': '/mp'}
print(123)
本文转自 295631788 51CTO博客,原文链接:http://blog.51cto.com/hequan/2063631,如需转载请自行联系原作者