微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Django RQ asyncio.TimeoutError

如何解决Django RQ asyncio.TimeoutError

我使用 django-rq 和 redis 来处理队列任务。 超时:6000 但我收到超时错误

不知何故,当我第一次开始工作时它可以工作,并且这段代码也可以在没有队列的情况下工作

这是我的队列代码

queue = django_rq.get_queue('default',is_async=True,default_timeout=6000)

queue.enqueue(send_msg,args=(mesaj,cat,url,image_url,startDate,endDate),timeout=5400)

这是我的错误代码

Traceback (most recent call last):
  File "/home/dir/venv/lib/python3.8/site-packages/rq/worker.py",line 1013,in perform_job
    rv = job.perform()
  File "/home/dir/venv/lib/python3.8/site-packages/rq/job.py",line 709,in perform
    self._result = self._execute()
  File "/home/dir/venv/lib/python3.8/site-packages/rq/job.py",line 732,in _execute
    result = self.func(*self.args,**self.kwargs)
  File "/home/dir/game/management/commands/game_bot/dc/dc_msg.py",line 370,in send_msg
    client.run(token)
  File "/home/dir/venv/lib/python3.8/site-packages/discord/client.py",line 723,in run
    return future.result()
  File "/home/dir/venv/lib/python3.8/site-packages/discord/client.py",line 702,in runner
    await self.start(*args,**kwargs)
  File "/home/dir/venv/lib/python3.8/site-packages/discord/client.py",line 665,in start
    await self.login(*args,bot=bot)
  File "/home/dir/venv/lib/python3.8/site-packages/discord/client.py",line 511,in login
    await self.http.static_login(token.strip(),bot=bot)
  File "/home/dir/venv/lib/python3.8/site-packages/discord/http.py",line 300,in static_login
    data = await self.request(Route('GET','/users/@me'))
  File "/home/dir/venv/lib/python3.8/site-packages/discord/http.py",line 192,in request
    async with self.__session.request(method,**kwargs) as r:
  File "/home/dir/venv/lib/python3.8/site-packages/aiohttp/client.py",line 1117,in __aenter__
    self._resp = await self._coro
  File "/home/dir/venv/lib/python3.8/site-packages/aiohttp/client.py",line 619,in _request
    break
  File "/home/dir/venv/lib/python3.8/site-packages/aiohttp/helpers.py",line 656,in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。