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

Regularly trigger ADD_CALENDAR to ensure calendar fetcher is running #1589

Merged
merged 1 commit into from Feb 26, 2019

Conversation

hudashot
Copy link
Contributor

Currently an ADD_CALENDAR notification is only sent once when the calendar module is started in the UI. This notification creates a calendar fetcher on the server side that is used to regularly update the calendar.

When MagicMirror is running in serveronly mode, the server process can be restarted even while the UI keeps running. When the server process restarts, it launches with no calendar fetchers running, and there is currently no way to start them again other than to refresh the UI.

This change just fires an ADD_CALENDAR event every fetch interval. When such event is received by the server that already has a fetcher running, it's effectively ignored (i.e. no duplicate fetcher is started), however if there is no fetcher running (because the server has been restarted) this makes sure it gets started.

@hudashot
Copy link
Contributor Author

Updated CHANGELOG.md.

@MichMich
Copy link
Collaborator

It might be a cleaner idea to broadcast a message to all modules whenever the socket connection is (re-) established. In that case you can broadcast ADD_CALENDAR whenever this happens. For now your solution seems fine and we can always change the impementation... Thanks!

@MichMich MichMich merged commit de99c8a into MagicMirrorOrg:develop Feb 26, 2019
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