WeAreFairphone / fprsmap

This is a Leaflet map of the local Fairphoners communities
https://map.fairphone.community
GNU General Public License v3.0
10 stars 7 forks source link

Optimize the scheduled update of the map #97

Open Ingo-FP-Angel opened 2 years ago

Ingo-FP-Angel commented 2 years ago

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

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 commented 2 years ago

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...