-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crontab stopped running #34
Comments
Probably a dupplicate of a known issue with aiohttp See #21 |
I'm not sure to understand the issue you linked. It used to work, even when I don't even use the aiohttp in the cron function. |
aiohttp use a new event loop when none is specified. this break coroutines initiated with the original event loop https://github.com/aio-libs/aiohttp/blob/master/aiohttp/web.py#L487 just use |
@aiocron.crontab("*/15 * * * *")
async def gather_new_missions():
print("test")
# do stuff here
async with aiohttp.ClientSession() as session:
url = "example.com"
async with session.get(url) as resp:
if resp.status == 200:
f = await aiofiles.open(filename, mode="wb")
await f.write(await resp.read())
await f.close() So this code wouldn't even print "test" because of aiohttp way of implementing a loop ? |
Yeah it's hard to help here. I'm trying. But I have no other clue Everything seems to work with 3.10 so the problem should be on your side. Related to your code or a third-party library https://github.com/gawel/aiocron/actions/runs/3376501956/jobs/5604299015 |
I've created a crontab in my code and deployed it to a server.
Everything ran fine until one month ago i'd say.
Now my code run, but the crontab never get run.
No idea why.
I'll provide as much info as needed.
Infos :
Python 3.10.6
Modules:
aiocron-1.8
pyairtable-1.3.0
Jinja2-3.1.2
discord.py-2.0.1
aiohttp
aiofiles
If you have any idea, even running it locally with cron set to everyminute doesn't do anything
The text was updated successfully, but these errors were encountered: