mirror of https://github.com/M66B/FairEmail.git
Store unrecoverable
This commit is contained in:
parent
1db59c34ac
commit
ebf162070e
|
@ -4168,6 +4168,7 @@ class Core {
|
|||
private Semaphore semaphore = new Semaphore(0);
|
||||
private boolean running = true;
|
||||
private boolean recoverable = true;
|
||||
private Throwable unrecoverable = null;
|
||||
private Long lastActivity = null;
|
||||
|
||||
private boolean process = false;
|
||||
|
@ -4244,6 +4245,9 @@ class Core {
|
|||
if (ex instanceof OperationCanceledException)
|
||||
recoverable = false;
|
||||
|
||||
if (!recoverable)
|
||||
unrecoverable = ex;
|
||||
|
||||
if (!backingoff) {
|
||||
thread.interrupt();
|
||||
yield();
|
||||
|
@ -4297,6 +4301,10 @@ class Core {
|
|||
return recoverable;
|
||||
}
|
||||
|
||||
Throwable getUnrecoverable() {
|
||||
return unrecoverable;
|
||||
}
|
||||
|
||||
void join(Thread thread) {
|
||||
boolean joined = false;
|
||||
boolean interrupted = false;
|
||||
|
|
|
@ -1469,8 +1469,13 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
" Tune interval=" + account.poll_interval +
|
||||
" idle=" + idleTime + "/" + tune);
|
||||
try {
|
||||
if (!state.isRecoverable())
|
||||
throw new StoreClosedException(iservice.getStore(), "Unrecoverable");
|
||||
if (!state.isRecoverable()) {
|
||||
Throwable ex = state.getUnrecoverable();
|
||||
if (ex instanceof Exception)
|
||||
throw new StoreClosedException(iservice.getStore(), "Unrecoverable", (Exception) ex);
|
||||
else
|
||||
throw new StoreClosedException(iservice.getStore(), "Unrecoverable");
|
||||
}
|
||||
|
||||
// Sends store NOOP
|
||||
EntityLog.log(ServiceSynchronize.this, account.name + " checking store");
|
||||
|
|
Loading…
Reference in New Issue