From a03bef1436774e8937a90df2927babc52608d150 Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 27 Mar 2017 10:57:45 -0700 Subject: Hopefully fixing 504s --- src/main/scala/xyz/driver/core/rest.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/scala') diff --git a/src/main/scala/xyz/driver/core/rest.scala b/src/main/scala/xyz/driver/core/rest.scala index d3a06d2..e812eaf 100644 --- a/src/main/scala/xyz/driver/core/rest.scala +++ b/src/main/scala/xyz/driver/core/rest.scala @@ -5,7 +5,6 @@ import akka.http.scaladsl.Http import akka.http.scaladsl.model._ import akka.http.scaladsl.model.headers.{HttpChallenges, RawHeader} import akka.http.scaladsl.server.AuthenticationFailedRejection.CredentialsRejected -import akka.http.scaladsl.server.Directive0 import akka.http.scaladsl.unmarshalling.Unmarshal import akka.http.scaladsl.unmarshalling.Unmarshaller import akka.stream.ActorMaterializer @@ -294,7 +293,10 @@ package rest { } else if (response.status.isFailure()) { throw new Exception(s"Http status is failure ${response.status}") } else { - Unmarshal(response.entity) + val entity = response.entity + // See https://github.com/akka/akka/issues/19538 + entity.toStrict(5000L, materializer) + Unmarshal(entity) } } } -- cgit v1.2.3