Skip to content
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

[bug] Cronical skip one hour during daylight saving #898

Open
StefanoTesla opened this issue Oct 28, 2024 · 0 comments
Open

[bug] Cronical skip one hour during daylight saving #898

StefanoTesla opened this issue Oct 28, 2024 · 0 comments

Comments

@StefanoTesla
Copy link

StefanoTesla commented Oct 28, 2024

I have a laravel application and I use cronical installed as service (I'm on windows) to make the scheduler running.

Sunday night during daylight saving time shift something strange happens, take a look of the log time:

[2024-10-27 00:56:04] local.INFO: Short report finished
[2024-10-27 02:01:02] local.INFO: Short report started at: 2024-10-27 02:01:02

[2024-10-27 02:01:02] local.INFO: Handling data from: 2024-10-27 02:55 to: 2024-10-27 02:00  
[2024-10-27 02:01:03] local.INFO: Handling data from: 2024-10-27 02:00 to: 2024-10-27 02:05  
..process the rest of the hour splitted in five minutes 

[2024-10-27 02:01:03] local.INFO: Handling data from: 2024-10-27 02:55 to: 2024-10-27 03:00 <<3:00 is right cause I format time in my timezone on ther log

[2024-10-27 02:01:05] local.INFO: Short report finished  
[2024-10-27 02:06:02] local.INFO: Short report started at: 2024-10-27 02:06:02  
[2024-10-27 02:06:02] local.INFO: Handling data from: 2024-10-27 03:00 to: 2024-10-27 03:05  

As you can see the log time pass from 00:56 to 2:01.....why?
Laravel timezone is UTC and I use to store data in UTC to avoid problem with the (I hate it) daylight saving time.

A problem with my code? propably but:

This is another log, handled always from the same laravel distro and run every 10seconds:

[2024-10-27 00:59:52] local.INFO: --- Weather Station Data Acquisition finish ---
[2024-10-27 02:00:02] local.INFO: GW2000 Data ack in 0.117 s
[2024-10-27 02:00:02] local.INFO: --- Weather Station Data Acquisition finish ---
[2024-10-27 02:00:12] local.INFO: GW2000 Data ack in 0.379 s

Olso here the same problem, the log time pass from 00:56 to 02:00.

Ok, my app is buggy, let me see the Cronical log:

2024-10-27 02:47:01.275       [3] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:48:01.017       [30] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:49:00.787       [19] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:50:01.569       [28] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:51:01.354       [27] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:52:01.104       [24] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:53:00.873       [26] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:54:01.670       [25] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:55:01.455       [29] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:56:01.205       [9] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:57:00.943       [10] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:58:01.708       [21] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:59:01.494       [20] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:00:01.352       [20] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:01:01.136       [21] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:02:00.903       [10] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:03:01.685       [9] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:04:01.468       [29] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:05:01.235       [25] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:06:00.987       [26] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:07:01.785       [24] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:08:01.552       [27] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:09:01.320       [28] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:10:01.072       [19] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:11:00.839       [30] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:12:01.607       [3] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:13:01.358       [34] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:14:01.141       [43] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:15:00.876       [42] Starting job: C:\laragon\www\ascomconnector\schedule.bat

When daylight saving time ends in winter, the clocks go back from 3:00 to 2:00, meaning we experience the 2 hour twice.

In this case I was expecting to se something like this:

2024-10-27 02:57:00.943       [10] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:58:01.708       [21] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:59:01.494       [20] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:00:01.494       [20] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:01:01.494       [20] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 02:02:01.494       [20] Starting job: C:\laragon\www\ascomconnector\schedule.bat
...one hour of log but at the 2:xx hour end finally the 3:xx hour...
2024-10-27 03:00:01.352       [20] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:01:01.136       [21] Starting job: C:\laragon\www\ascomconnector\schedule.bat
2024-10-27 03:02:00.903       [10] Starting job: C:\laragon\www\ascomconnector\schedule.bat

So i can confirm that croincal just add time to the actual time without consider the possibility of a time shift fro daylight saving time

UTC don't have timezone so for one hour Cronical didn't work???

@StefanoTesla StefanoTesla changed the title [bug?] Cronical skip one hour during daylight saving [bug] Cronical skip one hour during daylight saving Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant