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

Projects
None yet
2 participants
@hudashot
Copy link
Contributor

hudashot commented Feb 25, 2019

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 hudashot force-pushed the hudashot:calendar branch from fd121b3 to d3b8dbe Feb 26, 2019

@hudashot

This comment has been minimized.

Copy link
Contributor Author

hudashot commented Feb 26, 2019

Updated CHANGELOG.md.

@MichMich

This comment has been minimized.

Copy link
Owner

MichMich commented Feb 26, 2019

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 MichMich:develop Feb 26, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
security/snyk - package.json (MichMich) No manifest changes detected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.