diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java index 962947b7..e12b5bff 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/WebserviceInit.java @@ -102,14 +102,16 @@ public class WebserviceInit implements ApplicationListener Initialize Services..."); SEBServerInit.INIT_LOGGER.info("----> "); - this.applicationEventPublisher.publishEvent(new SEBServerInitEvent(this)); - // Run the database integrity checks and fixes if configured this.dbIntegrityChecker.checkIntegrity(); // Create an initial admin account if requested and not already in the database this.adminUserInitializer.initAdminAccount(); + //emits SEBServerInitEvent + this.applicationEventPublisher.publishEvent(new SEBServerInitEvent(this)); + + SEBServerInit.INIT_LOGGER.info("----> *********************************************************"); SEBServerInit.INIT_LOGGER.info("----> *** Webservice Info: ***"); SEBServerInit.INIT_LOGGER.info("----> *********************************************************"); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/light/impl/LightInit.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/light/impl/LightInit.java index 28ecf0c8..7f60c9fc 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/light/impl/LightInit.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/light/impl/LightInit.java @@ -3,19 +3,13 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.light.impl; import ch.ethz.seb.sebserver.SEBServerInitEvent; import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig; -import ch.ethz.seb.sebserver.gbl.util.Result; -import ch.ethz.seb.sebserver.gbl.util.Utils; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.context.annotation.Lazy; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Service; import java.util.Collection; -import java.util.stream.Collectors; @Lazy @Service @@ -32,9 +26,9 @@ public class LightInit { @EventListener(SEBServerInitEvent.class) public void init() { -// if(isConnectionConfigAbsent()){ -// this.sebClientConfigDAO.createNew(createLightConnectionConfiguration()).getOrThrow(); -// } + if(isConnectionConfigAbsent()){ + this.sebClientConfigDAO.createNew(createLightConnectionConfiguration()).getOrThrow(); + } } private boolean isConnectionConfigAbsent() {