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:
parent
aa91f60278
commit
00bfc2c34f
2 changed files with 7 additions and 1 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue