From 8f8d89ae7468933e98fd0911d927197b65ae1b7b Mon Sep 17 00:00:00 2001 From: msizov Date: Tue, 21 May 2024 21:08:23 +0700 Subject: [PATCH] Reduce waiting time for head restart (#483) --- src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt index 2f86142c4..75868db55 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt @@ -87,7 +87,7 @@ abstract class AbstractHead @JvmOverloads constructor( // close internal stream if upstream is finished, otherwise it gets stuck, // but technically it should never happen during normal work, only when the Head // is stopping - if (it == SignalType.ON_ERROR && !stopping) { + if ((it == SignalType.ON_ERROR || it == SignalType.CANCEL || it == SignalType.ON_COMPLETE) && !stopping) { log.warn("Received signal $upstreamId $it unexpectedly - restart head") lastHeadUpdated = 0L } else {