Don't pop notifications for serviceunavailable errors.

pull/2/head
Tom Hacohen 7 years ago
parent 942276284e
commit 09196e52a5

@ -79,6 +79,9 @@ public class CalendarsSyncAdapterService extends SyncAdapterService {
CalendarSyncManager syncManager = new CalendarSyncManager(getContext(), account, settings, extras, authority, syncResult, calendar, principal);
syncManager.performSync();
}
} catch (Exceptions.ServiceUnavailableException e) {
syncResult.stats.numIoExceptions++;
syncResult.delayUntil = (e.retryAfter > 0) ? e.retryAfter : Constants.DEFAULT_RETRY_DELAY;
} catch (Exception | OutOfMemoryError e) {
if (e instanceof CalendarStorageException || e instanceof SQLiteException) {
App.log.log(Level.SEVERE, "Couldn't prepare local calendars", e);

@ -80,6 +80,9 @@ public class ContactsSyncAdapterService extends SyncAdapterService {
}
} else
App.log.info("No CardDAV service found in DB");
} catch (Exceptions.ServiceUnavailableException e) {
syncResult.stats.numIoExceptions++;
syncResult.delayUntil = (e.retryAfter > 0) ? e.retryAfter : Constants.DEFAULT_RETRY_DELAY;
} catch (Exception | OutOfMemoryError e) {
String syncPhase = SyncManager.SYNC_PHASE_JOURNALS;
String title = getContext().getString(R.string.sync_error_contacts, account.name);

@ -183,6 +183,7 @@ abstract public class SyncManager {
App.log.log(Level.WARNING, "I/O exception during sync, trying again later", e);
syncResult.stats.numIoExceptions++;
} catch (Exceptions.ServiceUnavailableException e) {
syncResult.stats.numIoExceptions++;
syncResult.delayUntil = (e.retryAfter > 0) ? e.retryAfter : Constants.DEFAULT_RETRY_DELAY;
} catch (InterruptedException e) {

Loading…
Cancel
Save