Skip to content

Commit 4b13743

Browse files
Issue 1087/default batch interval (#1090)
* Set default value for CLEAR_EXPIRED_TOKENS_BATCH_INTERVAL to sleep(0). * Document default value of 0 for CLEAR_EXPIRED_TOKENS_BATCH_INTERVAL. Co-authored-by: Andrew Chen Wang <[email protected]>
1 parent a6a21d3 commit 4b13743

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/settings.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,13 @@ The size of delete batches used by ``cleartokens`` management command.
345345

346346
CLEAR_EXPIRED_TOKENS_BATCH_INTERVAL
347347
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348-
Default: ``0.1``
348+
Default: ``0``
349349

350350
Time of sleep in seconds used by ``cleartokens`` management command between batch deletions.
351351

352+
Set this to a non-zero value (e.g. `0.1`) to add a pause between batch sizes to reduce system
353+
load when clearing large batches of expired tokens.
354+
352355

353356
Settings imported from Django project
354357
--------------------------

oauth2_provider/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
# Should only be required in testing.
103103
"ALWAYS_RELOAD_OAUTHLIB_CORE": False,
104104
"CLEAR_EXPIRED_TOKENS_BATCH_SIZE": 10000,
105-
"CLEAR_EXPIRED_TOKENS_BATCH_INTERVAL": 0.1,
105+
"CLEAR_EXPIRED_TOKENS_BATCH_INTERVAL": 0,
106106
}
107107

108108
# List of settings that cannot be empty

0 commit comments

Comments
 (0)