fix: area cache invalidation for routing expressions#1615
Open
justiandevs wants to merge 1 commit into
Open
Conversation
- Ensure invalidation whenever an Area or AreaType instance is created, updated, deleted or imported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In this PR I built a solution for an issue that multiple municipalities, and we ourselves, have been running into for quite some time.
After creating, editing, deleting or importing an
AreaorAreaType, routing expressions that depended on those changes did not start working immediately. To make them work, we first had to restart the relevant worker.The root cause was that areas in the
SignalContextclass was initialized once and then kept in memory for the lifetime of the process. Because that cache was not invalidated after changes to areas or area types, routing kept using the initial areas value instead of the updated data from the database.This PR adds cache invalidation for changes to
AreaandAreaType, including import actions, so workers can refresh their local area cache without needing a restart.Checklist
mainand is up to date withmainmainHow has this been tested?