Skip to content

Commit

Permalink
Update DotcomRenderingService.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielCliftonGuardian committed Dec 10, 2024
1 parent 265d98f commit 2535875
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions common/app/renderers/DotcomRenderingService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class DotcomRenderingService extends GuLogging with ResultWithPreconnectPreload
payload: String,
endpoint: String,
cacheTime: CacheTime,
timeout: Duration = if (Configuration.environment.stage == "DEV") Configuration.rendering.timeout * 5 else Configuration.rendering.timeout,
timeout: Duration = Configuration.rendering.timeout,
)(implicit request: RequestHeader): Future[Result] = {
def handler(response: WSResponse): Result = {
response.status match {
Expand Down Expand Up @@ -258,6 +258,13 @@ class DotcomRenderingService extends GuLogging with ResultWithPreconnectPreload
})
}

private def getTimeout: Duration = {
if (Configuration.environment.stage == "DEV")
Configuration.rendering.timeout * 5
else
Configuration.rendering.timeout
}

def getFront(
ws: WSClient,
page: PressedPage,
Expand All @@ -278,7 +285,8 @@ class DotcomRenderingService extends GuLogging with ResultWithPreconnectPreload
)

val json = DotcomFrontsRenderingDataModel.toJson(dataModel)
post(ws, json, Configuration.rendering.faciaBaseURL + "/Front", CacheTime.Facia)
val timeout = getTimeout
post(ws, json, Configuration.rendering.faciaBaseURL + "/Front", CacheTime.Facia, timeout)
}

def getTagPage(
Expand Down

0 comments on commit 2535875

Please sign in to comment.