1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-11-24 04:46:00 -06:00

Set max concurrency in sync worker (#296)

This commit is contained in:
Rafał Borcz 2019-03-23 01:12:17 +01:00 committed by Mikołaj Pich
parent 316cd2f7f9
commit 2d6610e05c

View File

@ -19,6 +19,7 @@ import io.github.wulkanowy.services.sync.channels.DebugChannel
import io.github.wulkanowy.services.sync.works.Work
import io.github.wulkanowy.utils.getCompatColor
import io.reactivex.Completable
import io.reactivex.Flowable
import io.reactivex.Single
import timber.log.Timber
import kotlin.random.Random
@ -41,7 +42,7 @@ class SyncWorker @AssistedInject constructor(
.flatMapCompletable { student ->
semesterRepository.getCurrentSemester(student)
.flatMapCompletable { semester ->
Completable.mergeDelayError(works.map { it.create(student, semester) })
Completable.mergeDelayError(Flowable.fromIterable(works.map { it.create(student, semester) }), 3)
}
}
} else Completable.complete()