Do not loop sync in case of JsonEncodingException (if HS is down)

This commit is contained in:
Benoit Marty 2019-04-11 16:23:34 +02:00
parent d2e1aff453
commit 5dca31e6f9
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@
package im.vector.matrix.android.internal.session.sync.job
import com.squareup.moshi.JsonEncodingException
import im.vector.matrix.android.api.MatrixCallback
import im.vector.matrix.android.api.failure.Failure
import im.vector.matrix.android.api.util.Cancelable
@ -118,7 +119,8 @@ internal class SyncThread(private val syncTask: SyncTask,
Timber.e(failure)
}
if (failure !is Failure.NetworkConnection) {
if (failure !is Failure.NetworkConnection
|| failure.cause is JsonEncodingException) {
// Wait 10s before retrying
sleep(RETRY_WAIT_TIME_MS)
}