6.12.2019
This commit is contained in:
@@ -13,39 +13,39 @@ public class main {
|
||||
Log.setLevel(Log.DEBUG);
|
||||
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
Log.warning("Shutting down ...");
|
||||
|
||||
//shutdown routine
|
||||
} catch (InterruptedException e) {
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}));
|
||||
|
||||
//initial connect to db
|
||||
//initial connect to db
|
||||
Log.message("initial login to db");
|
||||
new Thread(() -> {
|
||||
try {
|
||||
JDCB.init("users", "kOpaIJUjkgb9ur6S", "wasteinformation","192.168.65.15",3306);
|
||||
} catch (IOException e) {
|
||||
//e.printStackTrace();
|
||||
Log.error("no connection to db");
|
||||
}
|
||||
}).start();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
JDCB.init("users", "kOpaIJUjkgb9ur6S", "wasteinformation", "192.168.65.15", 3306);
|
||||
} catch (IOException e) {
|
||||
//e.printStackTrace();
|
||||
Log.error("no connection to db");
|
||||
}
|
||||
}).start();
|
||||
|
||||
//startup web server
|
||||
//startup web server
|
||||
Thread mythread = new Thread(() -> new Webserver().startserver());
|
||||
mythread.start();
|
||||
|
||||
|
||||
//startup mqtt service
|
||||
Log.message("starting mqtt service");
|
||||
try{
|
||||
try {
|
||||
mqtt m = new mqtt();
|
||||
m.notifymessage();
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user