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 3fdb570 commit 331847b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public Invitation teamIds(List<String> teamIds) {

@JsonProperty("teams")
@JsonIgnore // ignore field "teams" because it is not present in InvitationRepresentation (class
// io.phasetwo.client.openapi.model.InvitationRepresentation)
// io.phasetwo.client.openapi.model.InvitationRepresentation)
public List<String> getTeamIds() {
return teamIds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import lombok.extern.jbosslog.JBossLog;
import org.keycloak.connections.jpa.JpaConnectionProvider;
import org.keycloak.models.KeycloakSession;
import org.keycloak.services.managers.AppAuthManager;

/** */
@JBossLog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ public void postInit(KeycloakSessionFactory factory) {
realmPostCreate((RealmModel.RealmPostCreateEvent) event);
} else if (event instanceof PostMigrationEvent) {
log.debug("PostMigrationEvent");
KeycloakModelUtils.runJobInTransaction(factory, this::initRoles);
if (System.getenv("KC_ORGS_SKIP_MIGRATION") == null) {
log.info("initializing organization roles following migration");
KeycloakModelUtils.runJobInTransaction(factory, this::initRoles);
}
} else if (event instanceof RealmModel.RealmRemovedEvent) {
log.debug("RealmRemovedEvent");
realmRemoved((RealmModel.RealmRemovedEvent) event);
Expand Down

0 comments on commit 331847b

Please sign in to comment.