0

我将 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, url, **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
4

0 回答 0