mirror of
https://github.com/signalapp/Signal-Server
synced 2026-07-07 09:25:05 +01:00
Avoid automatic, unbounded requests on subscription
This commit is contained in:
committed by
Jon Chambers
parent
1f0b2ad92d
commit
fa4d3c7ca9
+7
@@ -14,6 +14,7 @@ import java.util.function.BiConsumer;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import io.micrometer.core.instrument.Counter;
|
||||
import io.micrometer.core.instrument.Metrics;
|
||||
import org.reactivestreams.Subscription;
|
||||
import org.whispersystems.textsecuregcm.metrics.MetricsUtil;
|
||||
import org.whispersystems.textsecuregcm.storage.foundationdb.FoundationDbMessageStream;
|
||||
import org.whispersystems.textsecuregcm.util.UUIDUtil;
|
||||
@@ -80,6 +81,12 @@ public class AcknowledgementMirroringMessageStream implements MessageStream {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void hookOnSubscribe(final Subscription subscription) {
|
||||
// The base `hookOnSubscribe` requests `Long.MAX_VALUE` elements, and that is something we're explicitly trying
|
||||
// to avoid with this subscriber
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void hookOnNext(final MessageStreamEntry.Envelope envelope) {
|
||||
mirroredMessageHandler.accept(
|
||||
|
||||
Reference in New Issue
Block a user