Merged
Conversation
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
blarghmatey
requested changes
Jan 16, 2026
main/settings.py
Outdated
Comment on lines
1564
to
1568
| REFRESH_TOKEN_EXPIRE_SECONDS = get_int( | ||
| name="REFRESH_TOKEN_EXPIRE_SECONDS", | ||
| default=60 * 60 * 24 * 30, # 30 days | ||
| description="Number of seconds until a refresh token expires", | ||
| ) |
Member
There was a problem hiding this comment.
This needs to be nested under a namespaced dictionary object for it to take effect https://django-oauth-toolkit.readthedocs.io/en/latest/settings.html#settings
cp-at-mit
approved these changes
Jan 16, 2026
cp-at-mit
reviewed
Jan 16, 2026
Contributor
cp-at-mit
left a comment
There was a problem hiding this comment.
I'm not sure how many of these expired tokens we regularly accumulate between running this command, but if it's a lot should we consider adding the following:
To prevent the CPU and RAM high peaks during deletion process use CLEAR_EXPIRED_TOKENS_BATCH_SIZE and CLEAR_EXPIRED_TOKENS_BATCH_INTERVAL settings to adjust the process speed.
a260ef1 to
9079f76
Compare
b2d0e3b to
650dd44
Compare
blarghmatey
approved these changes
Jan 16, 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.
What are the relevant tickets?
Related to #3142
Description (What does it do?)
Adds REFRESH_TOKEN_EXPIRE_SECONDS so that the
cleartokensmanagement command when run removes those refresh tokens whose lifetime is greater than the amount specified by REFRESH_TOKEN_EXPIRE_SECONDS settings.How can this be tested?
Make sure you have tokens that are older than 1 month.
Run
python manage.py cleartokensCheck that old tokens got removed.