Archived
0

stop edce if not login

This commit is contained in:
iMoHax
2015-08-11 17:47:30 +03:00
parent 0db35d204f
commit 83ddd5c3e9

View File

@@ -171,6 +171,12 @@ public class EDCE {
LOG.info("Start EDCE checker each {} sec", interval); LOG.info("Start EDCE checker each {} sec", interval);
checker = executor.scheduleAtFixedRate(new EDCEChecker(), 1, interval, TimeUnit.SECONDS); checker = executor.scheduleAtFixedRate(new EDCEChecker(), 1, interval, TimeUnit.SECONDS);
} }
public void stop(){
LOG.info("Stop EDCE checker");
if (checker != null){
checker.cancel(false);
}
}
public void shutdown() throws IOException { public void shutdown() throws IOException {
if (executor != null) { if (executor != null) {
@@ -215,6 +221,8 @@ public class EDCE {
LOG.trace("Read profile from ED"); LOG.trace("Read profile from ED");
session.readProfile(EDCE.this::parseAndCheck); session.readProfile(EDCE.this::parseAndCheck);
} }
} else {
stop();
} }
waiting = false; waiting = false;
} }