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

Optimize the scheduled update of the map #97

Open
Ingo-FP-Angel opened this issue Jul 29, 2021 · 1 comment
Open

Optimize the scheduled update of the map #97

Ingo-FP-Angel opened this issue Jul 29, 2021 · 1 comment

Comments

@Ingo-FP-Angel
Copy link
Member

At the moment the map is updated once per hour, which means the build and deploy jobs runs 24 times a day and mostly has nothing to update. Which wastes energy.

Some ideas to reduce the energy consumption

  • don't run during the night (not sure when a new event would usually start, but maybe it's enough the first update on a day is done at 08:00 UTC)
  • run only every 2 hours
  • if the angels.json and event.json files downloaded from the forum don't differ from the ones on the map, skip the remaining steps

In addition it might be a good idea to allow manually triggering the build and deploy if above optimizations would otherwise prevent an event from being updated in time (this would require some developer attention, though, and basically the idea was to automate everything so anyone can just post their events on the forums and they appear on the map automatically).

@Ingo-FP-Angel
Copy link
Member Author

It was quite a hassle to get the check right if the data files are not different and then skip the deployment.
After I got it working in principle I found that the JSONs have a field with the number of views for that topic. Which seems to get increased each time the github action downloads the file. So there's always a difference.

I have now changed the cron expression to hourly between 06:00 and 23:00 and this seems like all the effort I'd like to invest in this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant