diff --git a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt index e08da60f0f..f8ba452203 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt @@ -46,6 +46,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.subscribeBy import java.util.* +import java.util.concurrent.TimeUnit import javax.inject.Inject import javax.inject.Singleton @@ -81,6 +82,7 @@ class CommandQueueImplementation @Inject constructor( disposable += rxBus .toObservable(EventProfileSwitchChanged::class.java) .observeOn(aapsSchedulers.io) + .throttleLatest(3L, TimeUnit.SECONDS) .subscribe({ if (config.NSCLIENT) { // Effective profileswitch should be synced over NS, do not create EffectiveProfileSwitch here return@subscribe