mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
cancel running services before restart
This commit is contained in:
parent
39d1e686f4
commit
722fd84ec1
1 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue