chore: Test if materializerPromise is already completed first. (#2117)
This commit is contained in:
parent
95820eda15
commit
39cbb3936e
1 changed files with 5 additions and 1 deletions
|
|
@ -96,7 +96,11 @@ final class SystemMaterializer(system: ExtendedActorSystem) extends Extension {
|
|||
|
||||
val materializer: Materializer = {
|
||||
// block on async creation to make it effectively final
|
||||
Await.result(systemMaterializerPromise.future, materializerTimeout.duration)
|
||||
val future = systemMaterializerPromise.future
|
||||
future.value match {
|
||||
case Some(value) => value.get
|
||||
case _ => Await.result(future, materializerTimeout.duration)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue