Adding an index for the revoked tokens table to speed up the cleanup (#31790)

Closes #31725

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
Alexander Schwartz 2024-08-01 11:12:53 +02:00 committed by GitHub
parent aa91f60278
commit 00bfc2c34f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -117,7 +117,7 @@ public class InfinispanSingleUseObjectProviderFactory implements SingleUseObject
@Override @Override
public void postInit(KeycloakSessionFactory factory) { public void postInit(KeycloakSessionFactory factory) {
// It is necessary to put the cache initialization here, otherwise the cache would be initialized lazily, that // It is necessary to put the cache initialization here, otherwise the cache would be initialized lazily, that
// means also listeners will start only after first cache initialization - that would be too latedddd // means also listeners will start only after first cache initialization - that would be too late
if (singleUseObjectCache == null) { if (singleUseObjectCache == null) {
this.singleUseObjectCache = getSingleUseObjectCache(factory.create()); this.singleUseObjectCache = getSingleUseObjectCache(factory.create());
} }

View file

@ -67,4 +67,10 @@
<addPrimaryKey columnNames="ID" constraintName="CONSTRAINT_RT" tableName="REVOKED_TOKEN"/> <addPrimaryKey columnNames="ID" constraintName="CONSTRAINT_RT" tableName="REVOKED_TOKEN"/>
</changeSet> </changeSet>
<changeSet author="keycloak" id="31725-index-persist-revoked-access-tokens">
<createIndex indexName="IDX_REV_TOKEN_ON_EXPIRE" tableName="REVOKED_TOKEN">
<column name="EXPIRE" />
</createIndex>
</changeSet>
</databaseChangeLog> </databaseChangeLog>