Skip to content

Commit

Permalink
Merge pull request #313 from Devoxx4Kids-NPO/bugfix/fix-insert-dev-mo…
Browse files Browse the repository at this point in the history
…de-not-triggered

Only checking insertDevData (org.littil.devservices.devdata)
  • Loading branch information
pschildkamp authored Feb 4, 2024
2 parents 1ad6410 + 42dddc9 commit dcde83f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/littil/api/ApplicationLifeCycle.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ public class ApplicationLifeCycle {
Auth0ManagementAPI auth0api;

void onStart(@Observes StartupEvent ev) {
if (this.insertDevData && ProfileManager.getLaunchMode().isDevOrTest()) {
if (this.insertDevData) {
persistDevData();
} else {
log.info("Skip persisting auth0 user data for development");
}
}

void persistDevData() {
log.info("Persisting auth0 user data to datasource, this should not be happening in staging nor production.");
log.info("Persisting auth0 user data to datasource, this should not be happening in staging nor production. LaunchMode: {}",ProfileManager.getLaunchMode());
DEV_USERS.entrySet().stream()
.flatMap(this::persistDevUserData)
.forEach(email -> log.info("Created {} user for development purposes", email));
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ org:
client:
id: ${M2M_CLIENT_ID:m2m_client_id}
secret: ${M2M_CLIENT_SECRET:m2m_client_secret}
devservices:
devdata: ${LITTIL_DEV_DATA:false}
quarkus:
live-reload:
instrumentation: true
Expand Down Expand Up @@ -134,6 +136,9 @@ quarkus:
password: ${DATASOURCE_PASSWORD:littil}
jdbc:
url: jdbc:mariadb://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/${DATASOURCE_DATABASE:littil}
http:
cors:
origins: ${HTTP_CORS_ORIGINS:}
log:
cloudwatch:
enabled: true
enabled: ${CLOUDWATCH_ENABLED:true}

0 comments on commit dcde83f

Please sign in to comment.