Open Askaholic opened 2 years ago
Well, you dont know if the coroutine will have to run before the process is closed. I don't see any option to do that.
It may be possible to track initiated coroutines and cancel them on atexit but I really don't like this idea. This kind of hook should not be used in a minimalist library IMHO
I've just started running my tests with
-W error
and sometimes I will see some failures that appear to be caused by this library scheduling a coroutine probably right as the event loop is closing, and then failing to call it.Here's where I create the cron:
I don't call
update_data
anywhere else in the entire code base except for a single unit test that directly tests the functionality, which passes fine so I know that's not the problem. So I think it must be happening because of this library.It also seems to happen mostly on GitHub Actions. I don't think I've actually had the tests fail for me locally with this error, which is really annoying because it makes it even harder to debug.
I'm not super familiar with the intricacies of the asyncio event loop
call_*
functions, but I wonder if there is some way to ensure that the coroutine is either run or not created at all.Python version: 3.9 Aiocron version: 1.8