gawel / aiocron

Crontabs for asyncio
MIT License
338 stars 20 forks source link

DST causing tasks to run twice. #28

Open coldshouldermedia opened 2 years ago

coldshouldermedia commented 2 years ago

I'm using aiocron as part of a simple bot that sends reminders. I currently have a VM with Ubuntu running a python script which sends a reminder at _1000 and _1200 and my log normally looks like this:

Wordle reminder sending...
Wordle reminder Sent.
AutoQOTD sending...
AutoQOTD Sent.

But today is the first day after a DST change, and the first function was sent at _9000 and again at _1000, and the second function was sent at _1200 and _1300. So my log ended up looking like this:

Wordle reminder sending...
Wordle reminder Sent.
Wordle reminder sending...
Wordle reminder Sent.
AutoQOTD sending...
AutoQOTD Sent.
AutoQOTD sending...
AutoQOTD Sent.

I haven't added log timestamps because I would have to restart the script and I didn't want to (temporarily) fix this issue before I collect any necessary info related to fixing this problem.

Is this a known problem? Is there more info I can provide on my situation? Have I implemented aiocron incorrectly to cause this issue?

gawel commented 2 years ago

It's a known bug. See #7

coldshouldermedia commented 2 years ago

Glad to know it's already noted.

In case it's helpful information, my program using aiocron has been running for days and after yesterdays issue, it seems that today aiocron is working correctly again. I only got one instance of each function as was expected.