Skip to content

Commit ca82041

Browse files
committed
try using attributes to get the timeout
1 parent 289beac commit ca82041

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
@@ -714,10 +714,11 @@ private[http] object HttpServerBluePrint {
714714
})
715715

716716
private var activeTimers = 0
717-
private val timeout = {
718-
import scala.jdk.DurationConverters._
719-
materializer.system.settings.config.getDuration(
720-
"pekko.stream.materializer.stream-ref.subscription-timeout").toScala
717+
private val timeout: FiniteDuration = {
718+
inheritedAttributes.get[ActorAttributes.StreamSubscriptionTimeout] match {
719+
case Some(attr) => attr.timeout
720+
case None => 5.minutes // should not happen
721+
}
721722
}
722723
private def addTimeout(s: SubscriptionTimeout): Unit = {
723724
if (activeTimers == 0) setKeepGoing(true)

0 commit comments

Comments
 (0)