Added an entity called Actions, it has two boolean values: updating and hasData. Updating is set to true when a pod starts updating the database and is set to false after the database update has completed. hasData is set to false before updating the database and is set to true after the database update has succeeded.
When a backend pod starts up it checks hasData to see if it needs to fetch initial data for the database. It will only do this immediate update to the database if hasData and updating are both false.
The cron job is currently set to fire once a day. Once one pod starts updating, all other pods will be blocked from doing so until the update job is done. Since the cron job starts at the same time in each pod (plus the random delay) only one of the pods should end up updating the database.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Description
Added an entity called Actions, it has two boolean values: updating and hasData. Updating is set to true when a pod starts updating the database and is set to false after the database update has completed. hasData is set to false before updating the database and is set to true after the database update has succeeded.
When a backend pod starts up it checks hasData to see if it needs to fetch initial data for the database. It will only do this immediate update to the database if hasData and updating are both false.
The cron job is currently set to fire once a day. Once one pod starts updating, all other pods will be blocked from doing so until the update job is done. Since the cron job starts at the same time in each pod (plus the random delay) only one of the pods should end up updating the database.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist
Further comments