Add rake task to remove old publishing intents #1360
Merged
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.
We use publish intents for schedule publishing to reduce the cache time ahead of publication. However, once the associated content items is published we don’t need the intent anymore.
Looks like from the code we only delete intents if we unschedule something - but we should also be delete them them when we publish the content item.
The number of Publish Intents has impact on the performance for route reloading in Router. Currently we have to scan (do an anti-join) through all the publish intents for routes - obviously that’d be far quicker if table had a 100s vs 10000s of rows.
Previously there used to be a cronjob that periodically cleaned up old publish intents (this is based on that).
However, I can't see the replacement functionality to delete publish intents once the document is published.
Adding this rake task to allow us to clean up the existing accumulation of Publish Intent.