fix(cleanup): remove expired wopi tokens with single delete query#5688
Open
Copilot wants to merge 1 commit into
Open
fix(cleanup): remove expired wopi tokens with single delete query#5688Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Copilot created this pull request from a session on behalf of
juliusknorr
May 21, 2026 09:12
View session
juliusknorr
approved these changes
May 21, 2026
Co-authored-by: Julius Knorr <jus@bitgrid.net> Signed-off-by: Julius Knorr <jus@bitgrid.net>
869d23f to
e6801ac
Compare
chrip
approved these changes
May 21, 2026
Contributor
chrip
left a comment
There was a problem hiding this comment.
Nice simplification. One concern: the old query used getExpiredTokenIds(1000) which deleted in batches of 1000. The new query deletes all expired tokens in a single statement, which could be expensive on large instances with many stale WOPI records.
Consider either:
- Keeping the batched approach (e.g. LIMIT 1000), or
- Adding a note in the PR description about expected scale and whether a single DELETE is safe for large deployments
Otherwise LGTM — the constant is a nice touch for readability.
AndyScherzinger
approved these changes
May 21, 2026
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.
Summary
Delete expired WOPI tokens directly with a single
DELETE ... WHERE expiry < ...query in the cleanup background job, instead of fetching/deleting only one 1000-token chunk.Also replaced the hardcoded 60-second value with a named constant to document the grace period used for cleanup.
TODO
Resolves(if applicable)Checklist