Add scheduled job to clean up orphaned inbox entries #1581
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.
Feature and bugfix in one PR!
This PR adds
sidekiq-scheduler
and our first scheduled job to go along with it,InboxCleanupScheduler
.This job runs every minute and cleans up orphaned inbox entries. This is a bug fix to prevent broken inboxes due to "somewhere down the line" deletion of something causing this behaviour. There is no case where this should happen, as to why the test case for this scheduler even has to disable validations on saving the broken record that is scheduled for deletion.
@nilsding this works fine locally without any change to the setup, but I'm not sure about how this ends up working with our deployment and what changes need to be made to accommodate this.