MountainDash / nonebot-bison

A nonebot2 plugin to repost social media posts to QQ group
https://nonebot-bison.netlify.app
MIT License
169 stars 35 forks source link

apscheduler偶发报错 #613

Closed enKl03B closed 3 months ago

enKl03B commented 3 months ago

环境

问题

(每隔1min即会报错)

日志

[ERROR] apscheduler | Job "Scheduler.exec_fetch (trigger: interval[0:01:00], next run at: 2024-08-15 22:19:56 CST)" raised an exception
Traceback (most recent call last):
  File "<string>", line 21, in <module>
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot\__init__.py", line 335, in run
    get_driver().run(*args, **kwargs)
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 186, in run
    uvicorn.run(
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\uvicorn\main.py", line 577, in run
    server.run()
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\uvicorn\server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 603, in run_forever
    self._run_once()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 1909, in _run_once
    handle._run()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
> File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\apscheduler\executors\base_py3.py", line 30, in run_coroutine_job
    retval = await job.func(*job.args, **job.kwargs)
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot_bison\scheduler\scheduler.py", line 109, in exec_fetch
    to_send = await platform_obj.do_fetch_new_post(SubUnit(schedulable.target, send_userinfo_list))
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 108, in do_fetch_new_post
    return await catch_network_error(self.fetch_new_post, sub_unit) or []
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 53, in catch_network_error
    return await func(*args, **kwargs)
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot_bison\platform\platform.py", line 342, in fetch_new_post
    post_list = await self.get_sub_list(sub_unit.sub_target)
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot_bison\platform\ff14.py", line 27, in get_sub_list
    client = await self.ctx.get_client()
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot_bison\utils\context.py", line 53, in get_client
    self._register_to_client(client)
  File "E:\MCL\nonebot\nb04-bot\nb04-bot\.venv\lib\site-packages\nonebot_bison\utils\context.py", line 28, in _register_to_client
    client.event_hooks = hooks
AttributeError: ("'NoneType' object has no attribute 'event_hooks'", [])
enKl03B commented 3 months ago

我的锅,没有搜issue#605