limit EventProfileSwitchChanged processing
This commit is contained in:
parent
07abc0f2b6
commit
49421da1d6
1 changed files with 2 additions and 0 deletions
|
@ -46,6 +46,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||||
import io.reactivex.rxjava3.kotlin.subscribeBy
|
import io.reactivex.rxjava3.kotlin.subscribeBy
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
|
@ -81,6 +82,7 @@ class CommandQueueImplementation @Inject constructor(
|
||||||
disposable += rxBus
|
disposable += rxBus
|
||||||
.toObservable(EventProfileSwitchChanged::class.java)
|
.toObservable(EventProfileSwitchChanged::class.java)
|
||||||
.observeOn(aapsSchedulers.io)
|
.observeOn(aapsSchedulers.io)
|
||||||
|
.throttleLatest(3L, TimeUnit.SECONDS)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
if (config.NSCLIENT) { // Effective profileswitch should be synced over NS, do not create EffectiveProfileSwitch here
|
if (config.NSCLIENT) { // Effective profileswitch should be synced over NS, do not create EffectiveProfileSwitch here
|
||||||
return@subscribe
|
return@subscribe
|
||||||
|
|
Loading…
Reference in a new issue