Browse Source

cancel running services before restart

bwt
Craig Raw 4 years ago
parent
commit
722fd84ec1
  1. 4
      src/main/java/com/sparrowwallet/sparrow/AppServices.java

4
src/main/java/com/sparrowwallet/sparrow/AppServices.java

@ -99,6 +99,10 @@ public class AppServices {
}; };
private void restartService(ScheduledService<?> service) { private void restartService(ScheduledService<?> service) {
if(service.isRunning()) {
service.cancel();
}
if(service.getState() == Worker.State.CANCELLED) { if(service.getState() == Worker.State.CANCELLED) {
service.reset(); service.reset();
} }

Loading…
Cancel
Save