- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: purge expired api keys in dbpurge#20863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
coderd/database/dbpurge/dbpurge.go Outdated
| // TODO: Arbitrary numbers are arbitrary... | ||
| LimitCount:10000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We know anapi_key migration takes so long it can timeout.
I don't like arbitrary numbers, but if this table is massive, we should spread the load out. DB purge runs every 10 minutes. 10k feels large, but not insane to be too slow?
| // Leave expired keys for a week to allow the backend to know the difference | ||
| // between a 404 and an expired key. This purge code is just to bound the size of | ||
| // the table to something more reasonable. | ||
| // TODO: Does this matter? | ||
| Before:dbtime.Time(start.Add(time.Hour*24*7*-1)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There is a behavior change if we purge expired keys. And I wonder if the difference between 404 & expired is good information.
Emyrk commentedNov 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
We are good. The oauth token is also deleted from the |
Emyrk commentedNov 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
ceb15c5 to11bf986CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
0cd1c02 to43290cdCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
cefe07d intomainUh oh!
There was an error while loading.Please reload this page.

Uh oh!
There was an error while loading.Please reload this page.
closes#19889
This is in response to a migration in v2.27 that takes very long on deployments with large
api_keytables.