Split filing edits into a fast DB apply and a debounced tile rebuild#98
Merged
Conversation
Applying an edit used to be one celery task that updated editfiles and kml_data and then rebuilt the folder's entire vector-tile set, so every edit cost a full tippecanoe run before it was reported done. The task is now a chain of two: - apply_edit_changes: persists the drawn polygons as editfiles, deletes the excluded kml_data rows, and refreshes the availability CSV for export filings. After this commits (seconds), database truth - and therefore exports - is correct; only the map tiles are stale. - regenerate_tiles: the slow tile rebuild, made single-flight per folder with a redis dirty flag so rapid consecutive edits coalesce instead of each paying a full rebuild. A queued rebuild that finds its folder clean no-ops, but a chain only reports SUCCESS once the tiles actually include its edit, so task completion keeps its meaning for clients. Without redis (e.g. the eager test broker) the debounce degrades to always rebuilding, which is correct, just less efficient. Tile-rebuild failures now log and surface through celery retries instead of being silently swallowed.
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.
Applying an edit used to be one celery task that updated editfiles and kml_data and then rebuilt the folder's entire vector-tile set, so every edit cost a full tippecanoe run before it was reported done. The task is now a chain of two:
Without redis (e.g. the eager test broker) the debounce degrades to always rebuilding, which is correct, just less efficient. Tile-rebuild failures now log and surface through celery retries instead of being silently swallowed.