Use shutdown or restart (using batch file for Windows).
When using restart and the batch file it just repeats for 4-5 seconds until it finally starts the bot again.
For the bot to exit/restart properly.
[2020-02-17 12:47:01] [INFO] red.main: Shutting down with exit code: ExitCodes.SHUTDOWN
[2020-02-17 12:47:01] [INFO] red.main: Please wait, cleaning up a bit more
[2020-02-17 12:47:03] [CRITICAL] red.main: Caught unhandled exception in task: 'NoneType' object has no attribute 'id'
[2020-02-17 12:47:03] [CRITICAL] red.main: Caught unhandled exception in task: 'NoneType' object has no attribute 'id'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000000002CBA670>
Traceback (most recent call last):
File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 715, in call_soon
self._check_closed()
File "C:\Users\*\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
After this it starts to repeat until starting the bot again, or just ends, after the repeats, if using shutdown.
Not a clue.
https://bugs.python.org/issue39232
This is the first I've seen this issue come up since we started manually handling closing the event loop (see BPO above for why) and wait 2 seconds for outstanding transports to be closed. That may not sound like much time, but considering that waiting happens after canceling out everything else the bot is doing, we expected it to be enough. We can't go much higher than this without running into issues with process managers killing services that don't close when told to do so.
I'm sorry. Don't really understand all of that stuff and what you said.
Just wanted to share what was happening.
Most helpful comment
I'm sorry. Don't really understand all of that stuff and what you said.
Just wanted to share what was happening.