mirror of https://github.com/M66B/FairEmail.git
Fixed restart
This commit is contained in:
parent
8619da79b5
commit
831db4569e
|
@ -1636,37 +1636,31 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
}
|
||||
|
||||
private void stop() {
|
||||
if (main != null) {
|
||||
EntityLog.log(ServiceSynchronize.this, "Main stop " + main);
|
||||
synchronized (state) {
|
||||
state.running = false;
|
||||
state.notifyAll();
|
||||
}
|
||||
|
||||
// stop wait or backoff
|
||||
main.interrupt();
|
||||
join(main);
|
||||
|
||||
main = null;
|
||||
state = null;
|
||||
|
||||
EntityLog.log(ServiceSynchronize.this, "Main stopped " + main);
|
||||
EntityLog.log(ServiceSynchronize.this, "Main stop " + main);
|
||||
synchronized (state) {
|
||||
state.running = false;
|
||||
state.notifyAll();
|
||||
}
|
||||
|
||||
// stop wait or backoff
|
||||
main.interrupt();
|
||||
join(main);
|
||||
|
||||
main = null;
|
||||
state = null;
|
||||
|
||||
EntityLog.log(ServiceSynchronize.this, "Main stopped " + main);
|
||||
}
|
||||
|
||||
private void restart() {
|
||||
lifecycle.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
stop();
|
||||
}
|
||||
});
|
||||
lifecycle.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
start();
|
||||
}
|
||||
});
|
||||
if (running)
|
||||
lifecycle.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
stop();
|
||||
start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private BroadcastReceiver outboxReceiver = new BroadcastReceiver() {
|
||||
|
|
Loading…
Reference in New Issue