diff --git a/app/src/main/java/at/bitfire/davdroid/syncadapter/CalendarsSyncAdapterService.java b/app/src/main/java/at/bitfire/davdroid/syncadapter/CalendarsSyncAdapterService.java index bb3d2d17..cbda25a4 100644 --- a/app/src/main/java/at/bitfire/davdroid/syncadapter/CalendarsSyncAdapterService.java +++ b/app/src/main/java/at/bitfire/davdroid/syncadapter/CalendarsSyncAdapterService.java @@ -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); diff --git a/app/src/main/java/at/bitfire/davdroid/syncadapter/ContactsSyncAdapterService.java b/app/src/main/java/at/bitfire/davdroid/syncadapter/ContactsSyncAdapterService.java index e3d40f14..2120fb35 100644 --- a/app/src/main/java/at/bitfire/davdroid/syncadapter/ContactsSyncAdapterService.java +++ b/app/src/main/java/at/bitfire/davdroid/syncadapter/ContactsSyncAdapterService.java @@ -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); diff --git a/app/src/main/java/at/bitfire/davdroid/syncadapter/SyncManager.java b/app/src/main/java/at/bitfire/davdroid/syncadapter/SyncManager.java index 8d437ad6..1fd9612f 100644 --- a/app/src/main/java/at/bitfire/davdroid/syncadapter/SyncManager.java +++ b/app/src/main/java/at/bitfire/davdroid/syncadapter/SyncManager.java @@ -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) {