From f498840c17a26c1b0433464cb20dad37c0865a1b Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 10 Nov 2022 23:14:02 +0000 Subject: [PATCH] reverting unused error emissions --- .../kotlin/app/dapk/st/matrix/sync/internal/FlowIterator.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/FlowIterator.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/FlowIterator.kt index 71e5208..e10368d 100644 --- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/FlowIterator.kt +++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/FlowIterator.kt @@ -7,7 +7,7 @@ import app.dapk.st.matrix.common.matrixLog import kotlinx.coroutines.* internal class SideEffectFlowIterator(private val logger: MatrixLogger, private val errorTracker: ErrorTracker) { - suspend fun loop(initial: T?, onPost: suspend (Throwable?) -> Unit, onIteration: suspend (T?) -> T?) { + suspend fun loop(initial: T?, onPost: suspend () -> Unit, onIteration: suspend (T?) -> T?) { var previousState = initial while (currentCoroutineContext().isActive) { @@ -16,12 +16,11 @@ internal class SideEffectFlowIterator(private val logger: MatrixLogger, private previousState = withContext(NonCancellable) { onIteration(previousState) } - onPost(null) + onPost() } catch (error: Throwable) { logger.matrixLog(SYNC, "on loop error: ${error.message}") errorTracker.track(error, "sync loop error") delay(10000L) - onPost(error) } } logger.matrixLog(SYNC, "isActive: ${currentCoroutineContext().isActive}")