Skip to content

Commit 5e0d265

Browse files
committed
try using attributes to get the timeout
1 parent 6347c4c commit 5e0d265

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,10 +721,11 @@ private[http] object HttpServerBluePrint {
721721
})
722722

723723
private var activeTimers = 0
724-
private val timeout = {
725-
import scala.jdk.DurationConverters._
726-
materializer.system.settings.config.getDuration(
727-
"pekko.stream.materializer.stream-ref.subscription-timeout").toScala
724+
private val timeout: FiniteDuration = {
725+
inheritedAttributes.get[ActorAttributes.StreamSubscriptionTimeout] match {
726+
case Some(attr) => attr.timeout
727+
case None => 5.minutes // should not happen
728+
}
728729
}
729730
private def addTimeout(s: SubscriptionTimeout): Unit = {
730731
if (activeTimers == 0) setKeepGoing(true)

0 commit comments

Comments
 (0)