celery的tasks执行requests请求时"maximum recursion depth exceeded"

发布于 2023-05-06 19:18:03

我的celery执行tasks的时候报错:"maximum recursion depth exceeded"

{"status": "FAILURE", "result": {"exc_type": "RecursionError", "exc_message": ["maximum recursion depth exceeded"], "exc_module": "builtins"}, "traceback": "Traceback (most recent call last):\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\celery\\app\\trace.py\", line 451, in trace_task\n    R = retval = fun(*args, **kwargs)\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\celery\\app\\trace.py\", line 734, in __protected_call__\n    return self.run(*args, **kwargs)\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\django-vue-admin-v2.1.2\\backend\\app_part_1\\wx_part\\tasks.py\", line 24, in get_cookie\n    resp = requests.post(url, json=token.get(\"data\"))\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\requests\\api.py\", line 119, in post\n    return request('post', url, data=data, json=json, **kwargs)\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\requests\\api.py\", line 61, in request\n    return session.request(method=method, url=url, **kwargs)\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\requests\\sessions.py\", line 530, in request\n    resp = self.send(prep, **send_kwargs)\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\requests\\sessions.py\", line 643, in send\n    r = adapter.send(request, **kwargs)\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\requests\\adapters.py\", line 439, in send\n    resp = conn.urlopen(\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\urllib3\\connectionpool.py\", line 670, in urlopen\n    httplib_response = self._make_request(\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\urllib3\\connectionpool.py\", line 381, in _make_request\n    self._validate_conn(conn)\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\urllib3\\connectionpool.py\", line 978, in _validate_conn\n    conn.connect()\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\urllib3\\connection.py\", line 343, in connect\n    self.ssl_context = create_urllib3_context(\n  File \"D:\\workspaces\\newland\\Ruoyi_Vue_Django\\venv\\lib\\site-packages\\urllib3\\util\\ssl_.py\", line 277, in create_urllib3_context\n    context.options |= options\n  File \"D:\\python_app\\Anaconca_test\\anaconda_1\\lib\\ssl.py\", line 602, in options\n    super(SSLContext, SSLContext).options.__set__(self, value)\n  File \"D:\\python_app\\Anaconca_test\\anaconda_1\\lib\\ssl.py\", line 602, in options\n    super(SSLContext, SSLContext).options.__set__(self, value)\n  File \"D:\\python_app\\Anaconca_test\\anaconda_1\\lib\\ssl.py\", line 602, in options\n    super(SSLContext, SSLContext).options.__set__(self, value)\n  [Previous line repeated 458 more times]\nRecursionError: maximum recursion depth exceeded\n", "children": [], "date_done": "2023-05-06T11:08:20.901262", "task_id": "801b822e-69f8-40b5-bb02-9c3e410a8a54"}

下面的是的的tasks,做一个请求

@shared_task
def get_cookie(token):
    url = "https://channels.weixin.qq.com/promote/api/web/auth/auth_login_status"
    resp = requests.post(url, json=token.get("data"))
    return resp.text

求大佬帮忙看下这个到底是哪里超过最大递归深度,我都没有写回调函数啊,真的是奇怪了

查看更多

关注者
0
被浏览
680
1 个回答
hongzai
hongzai 认证专家 2023-05-07
life is coding,外包,远程协助,咨询添加:H0nGzA1

检查代码吧,这点报错信息看不出个所以然

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览