Skip to content

Commit

Permalink
allow a KC_ORGS_SKIP_MIGRATION flag for large numbers of realms. TODO…
Browse files Browse the repository at this point in the history
… make this an --spi* var.
  • Loading branch information
xgp committed Jan 9, 2024
1 parent 6f81c3b commit e35fb4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.java.package>io.phasetwo.keycloak.events</main.java.package>
<junit.version>4.13.2</junit.version>
<keycloak.version>23.0.3</keycloak.version>
<keycloak.version>23.0.4</keycloak.version>
<lombok.version>1.18.30</lombok.version>
<auto-service.version>1.1.1</auto-service.version>
<ossrh.url>https://s01.oss.sonatype.org</ossrh.url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public void postInit(KeycloakSessionFactory factory) {
if (event instanceof RealmModel.RealmPostCreateEvent) {
realmPostCreate((RealmModel.RealmPostCreateEvent) event);
} else if (event instanceof PostMigrationEvent) {
KeycloakModelUtils.runJobInTransaction(factory, this::initRoles);
if (System.getenv("KC_ORGS_SKIP_MIGRATION") == null) {
log.info("initializing event roles following migration");
KeycloakModelUtils.runJobInTransaction(factory, this::initRoles);
}
}
});
}
Expand Down

0 comments on commit e35fb4f

Please sign in to comment.