Purge Outgoing Webhooks events and deliveries data #229
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.
closes #205
Goal of this PR is to add a background job that will purge data in the
webhooks_outgoing_events,webhooks_outgoing_deliveries, andwebhooks_outgoing_delivery_attemptstables with acreated_atolder than 90 days by default.We are assuming that the bullet train user will schedule this background job using whatever means they prefer to use in their application (i.e. leaving this up to the user and not adding some cron scheduling gem like
wheneverat this point. We can do this if we decide)Testing Done:
Tested the background job with locally running sidekiq server and calling the
Webhooks::Outgoing::PurgeJob.perform()with different number of days. Confirmed that the correct records are deleted from the database after the job is run. And that records that are not older than X days still remain in the table and are not deleted.