Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround to fetch all the pending toDevice events from a Synapse homeserver #4614

Merged
merged 8 commits into from
Dec 30, 2021
Prev Previous commit
Next Next commit
Add name to call argument and actually fix a mistake :/
  • Loading branch information
bmarty committed Dec 2, 2021
commit 78c3bff81f5201f02b47ae969a1ebaa95c545a41
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,14 @@ internal class SyncWorker(context: Context,
fun requireBackgroundSync(workManagerProvider: WorkManagerProvider,
sessionId: String,
serverTimeoutInSeconds: Long = 0) {
val data = WorkerParamsFactory.toData(Params(sessionId, serverTimeoutInSeconds, 0L, false))
val data = WorkerParamsFactory.toData(
Params(
sessionId = sessionId,
timeout = serverTimeoutInSeconds,
delay = 0L,
periodic = false
)
)
val workRequest = workManagerProvider.matrixOneTimeWorkRequestBuilder<SyncWorker>()
.setConstraints(WorkManagerProvider.workConstraints)
.setBackoffCriteria(BackoffPolicy.LINEAR, WorkManagerProvider.BACKOFF_DELAY_MILLIS, TimeUnit.MILLISECONDS)
Expand All @@ -141,7 +148,14 @@ internal class SyncWorker(context: Context,
serverTimeoutInSeconds: Long = 0,
delayInSeconds: Long = 30,
forceImmediate: Boolean = false) {
val data = WorkerParamsFactory.toData(Params(sessionId, serverTimeoutInSeconds, delayInSeconds, forceImmediate))
val data = WorkerParamsFactory.toData(
Params(
sessionId = sessionId,
timeout = serverTimeoutInSeconds,
delay = delayInSeconds,
forceImmediate = forceImmediate
)
)
val workRequest = workManagerProvider.matrixOneTimeWorkRequestBuilder<SyncWorker>()
.setConstraints(WorkManagerProvider.workConstraints)
.setInputData(data)
Expand Down