Fixed restart

pull/125/head
M66B 6 years ago
parent 8619da79b5
commit 831db4569e

@ -1636,7 +1636,6 @@ public class ServiceSynchronize extends LifecycleService {
} }
private void stop() { private void stop() {
if (main != null) {
EntityLog.log(ServiceSynchronize.this, "Main stop " + main); EntityLog.log(ServiceSynchronize.this, "Main stop " + main);
synchronized (state) { synchronized (state) {
state.running = false; state.running = false;
@ -1652,18 +1651,13 @@ public class ServiceSynchronize extends LifecycleService {
EntityLog.log(ServiceSynchronize.this, "Main stopped " + main); EntityLog.log(ServiceSynchronize.this, "Main stopped " + main);
} }
}
private void restart() { private void restart() {
if (running)
lifecycle.submit(new Runnable() { lifecycle.submit(new Runnable() {
@Override @Override
public void run() { public void run() {
stop(); stop();
}
});
lifecycle.submit(new Runnable() {
@Override
public void run() {
start(); start();
} }
}); });

Loading…
Cancel
Save