mirror of
https://github.com/jlengrand/cellar.git
synced 2026-03-10 08:01:19 +00:00
Disables monitoring flag for now
This commit is contained in:
@@ -2,7 +2,10 @@ package nl.lengrand.cellar;
|
||||
|
||||
import nl.lengrand.cellar.faunadb.SensorApi;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class CellarMonitor {
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package nl.lengrand.cellar;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
|
||||
@ApplicationScoped
|
||||
public class CellarMonitoring {
|
||||
|
||||
public void start(){
|
||||
System.out.println("Monitoring enabled by config. Starting up");
|
||||
CellarMonitor monitor = new CellarMonitor();
|
||||
monitor.startMonitoring();
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,21 @@
|
||||
package nl.lengrand.cellar;
|
||||
|
||||
import io.helidon.microprofile.server.Server;
|
||||
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Main {
|
||||
|
||||
@ConfigProperty(name = "monitoring.enabled", defaultValue = "true")
|
||||
private static boolean monitoringEnabled;
|
||||
|
||||
private Main() { }
|
||||
|
||||
public static void main(final String[] args) throws IOException {
|
||||
Server server = startServer();
|
||||
|
||||
if(monitoringEnabled) {
|
||||
System.out.println("Monitoring enabled by config. Starting up");
|
||||
startMonitoring();
|
||||
}
|
||||
else System.out.println("Monitoring disabled by config");
|
||||
|
||||
CellarMonitoring monitoring = new CellarMonitoring();
|
||||
monitoring.start();
|
||||
}
|
||||
|
||||
static Server startServer() {
|
||||
return Server.create().start();
|
||||
}
|
||||
|
||||
static void startMonitoring(){
|
||||
CellarMonitor monitor = new CellarMonitor();
|
||||
monitor.startMonitoring();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user