mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-06 12:54:11 +01:00
Fixed restart
This commit is contained in:
@@ -1636,37 +1636,31 @@ 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;
|
state.notifyAll();
|
||||||
state.notifyAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
// stop wait or backoff
|
|
||||||
main.interrupt();
|
|
||||||
join(main);
|
|
||||||
|
|
||||||
main = null;
|
|
||||||
state = null;
|
|
||||||
|
|
||||||
EntityLog.log(ServiceSynchronize.this, "Main stopped " + main);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stop wait or backoff
|
||||||
|
main.interrupt();
|
||||||
|
join(main);
|
||||||
|
|
||||||
|
main = null;
|
||||||
|
state = null;
|
||||||
|
|
||||||
|
EntityLog.log(ServiceSynchronize.this, "Main stopped " + main);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restart() {
|
private void restart() {
|
||||||
lifecycle.submit(new Runnable() {
|
if (running)
|
||||||
@Override
|
lifecycle.submit(new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
stop();
|
public void run() {
|
||||||
}
|
stop();
|
||||||
});
|
start();
|
||||||
lifecycle.submit(new Runnable() {
|
}
|
||||||
@Override
|
});
|
||||||
public void run() {
|
|
||||||
start();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BroadcastReceiver outboxReceiver = new BroadcastReceiver() {
|
private BroadcastReceiver outboxReceiver = new BroadcastReceiver() {
|
||||||
|
|||||||
Reference in New Issue
Block a user