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

added workaround for suncalc bug #11 #2

Merged
merged 1 commit into from
Sep 28, 2019
Merged

added workaround for suncalc bug #11 #2

merged 1 commit into from
Sep 28, 2019

Conversation

FranzHoffmann
Copy link

For me, suncron only worked on the first day. On the second day, no events happened.
I added some debug code, and found this:

25 Sep 00:00:05 - [warn] [suncron:Sonne] calcScheduleForToday()
25 Sep 00:00:05 - [warn] [suncron:Sonne] today: 2019-09-24T22:00:05.300Z
25 Sep 00:00:05 - [warn] [suncron:Sonne] event at 2019-09-24T04:17:27.766Z
25 Sep 00:00:05 - [warn] [suncron:Sonne] event at 2019-09-24T15:18:09.241Z
25 Sep 00:00:05 - [warn] [suncron:Sonne] 1 msg crons deleted
25 Sep 00:00:05 - [warn] [suncron:Sonne] sunriseEnd: WARNING: Date in past. Will never be fired.
25 Sep 00:00:05 - [warn] [suncron:Sonne] sunsetStart: WARNING: Date in past. Will never be fired.
25 Sep 00:00:05 - [warn] [suncron:Sonne] 2 msg crons installed

The cron-job ran on September 25 00:00:05 local time. 'today' is in UTC, still September 24. And suncalc calculates events for September 24.

I believe this is due to this issue in suncalc:
mourner/suncalc#11

I added the workaround, and it works for me.

@csuermann csuermann merged commit eb03feb into csuermann:master Sep 28, 2019
@csuermann
Copy link
Owner

@FranzHoffmann, thanks for the contribution! Much appreciated!

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

Successfully merging this pull request may close these issues.

None yet

2 participants