bossenti commented on code in PR #2136:
URL: https://github.com/apache/streampipes/pull/2136#discussion_r1382528298


##########
streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java:
##########
@@ -133,45 +129,54 @@ public void init() {
     }
     coreStatusManager.updateCoreStatus(SpCoreConfigurationStatus.READY);
 
-    executorService.schedule(new PostStartupTask(getPipelineStorage()), 10, 
TimeUnit.SECONDS);
-
-    scheduleHealthChecks(List.of(
-        new ServiceHealthCheck(),
-        new PipelineHealthCheck(),
-        new AdapterHealthCheck()));
-
-    LOG.info("Extensions logs will be fetched every {} seconds", 
LOG_FETCH_INTERVAL);
+    executorService.schedule(
+        new PostStartupTask(getPipelineStorage()),
+        env.getInitialHealthCheckDelayInMillis().getValueOrDefault(),
+        TimeUnit.MILLISECONDS);
+
+    scheduleHealthChecks(
+        env.getHealthCheckIntervalInMillis().getValueOrDefault(),
+        List.of(
+            new ServiceHealthCheck(),
+            new PipelineHealthCheck(),
+            new AdapterHealthCheck())
+    );
+
+    var logFetchInterval = 
env.getLogFetchIntervalInMillis().getValueOrDefault();
+    LOG.info("Extensions logs will be fetched every {} milliseconds", 
logFetchInterval);
     logCheckExecutorService.scheduleAtFixedRate(new 
ExtensionsServiceLogExecutor(),
-        LOG_FETCH_INTERVAL,
-        LOG_FETCH_INTERVAL,
-        LOG_FETCH_UNIT);
+        logFetchInterval,
+        logFetchInterval,
+        TimeUnit.MILLISECONDS);
   }
 
-  private void scheduleHealthChecks(List<Runnable> checks) {
+  private void scheduleHealthChecks(
+      int healthCheckIntervalInMillis,
+      List<Runnable> checks) {
     var healthCheckExecutorService = 
Executors.newSingleThreadScheduledExecutor();
     checks.forEach(check -> {
       LOG.info(
           "Health check {} configured to run every {} {}",
           check.getClass().getCanonicalName(),
-          HEALTH_CHECK_INTERVAL,
-          HEALTH_CHECK_UNIT);
+          healthCheckIntervalInMillis,
+          TimeUnit.MILLISECONDS);
       healthCheckExecutorService.scheduleAtFixedRate(check,
-          HEALTH_CHECK_INTERVAL,
-          HEALTH_CHECK_INTERVAL,
-          HEALTH_CHECK_UNIT);
+          healthCheckIntervalInMillis,
+          healthCheckIntervalInMillis,
+          TimeUnit.MILLISECONDS);
     });
   }
 
   private boolean isConfigured() {
     return new UserStorage().existsDatabase();
   }
 
-  private void doInitialSetup() {
+  private void doInitialSetup(int initialSleepBeforeInstallation) {
     LOG.info("\n\n**********\n\nWelcome to Apache 
StreamPipes!\n\n**********\n\n");
     LOG.info("We will perform the initial setup, grab some coffee and cross 
your fingers ;-)...");
     LOG.info("Auto-setup will start in 5 seconds to make sure all services are 
running...");

Review Comment:
   `5 seconds` needs to be printed dynamically



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to