今天遇到一个问题,发布华为云容器的时候,单个文件测试,是可以的。
但是在celery中,异步执行时报错。
ventletgreenssl.py", line 392, in wrap_socket return GreenSSLSocket(sock, *a, _context=self, **kw) File "c:userscangoenvspy3djangolibsite-packageseventletgreenssl.py", line 64, in __init__ ca_certs, do_handshake_on_connect and six.PY2, *args, **kw) File "c:userscangoappdatalocalprogramspythonpython37libssl.py", line 808, in __init__ f"{self.__class__.__name__} does not have a public " TypeError: GreenSSLSocket does not have a public constructor. Instances are returned by SSLContext.wrap_socket(). worker: Hitting Ctrl+C again will terminate all running tasks!
搜了半天,有的解决方法是 把python的环境的3.7换成3.6。
最终找到了这种方式 将 eventlet==0.24.1的版本升级到0.26.0
参考:https://ask.csdn.net/questions/1427230
https://www.it610.com/article/1292600447600762880.htm
https://ask.csdn.net/questions/1427264