double checking the sync state in order to avoid redundant invalid token events

This commit is contained in:
Adam Brown 2021-11-08 14:34:32 +00:00
parent f61d20a7f8
commit 52731cf59d

View file

@ -160,6 +160,9 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
synchronized(lock) { lock.wait() }
Timber.tag(loggerTag.value).d("...retry")
} else if (!isTokenValid) {
if (state == SyncState.Killing) {
continue
}
Timber.tag(loggerTag.value).d("Token is invalid. Waiting...")
updateStateTo(SyncState.InvalidToken)
synchronized(lock) { lock.wait() }