aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/scala/com/drivergrp/core/app.scala4
-rw-r--r--src/main/scala/com/drivergrp/core/rest.scala4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/main/scala/com/drivergrp/core/app.scala b/src/main/scala/com/drivergrp/core/app.scala
index 8018ab4..17c63f5 100644
--- a/src/main/scala/com/drivergrp/core/app.scala
+++ b/src/main/scala/com/drivergrp/core/app.scala
@@ -109,13 +109,15 @@ object app {
import SprayJsonSupport._
path("version") {
+ val currentTime = time.currentTime().millis
complete(
Map(
"version" -> version,
"gitHash" -> gitHash,
"modules" -> modules.map(_.name).mkString(", "),
"startupTime" -> startupTime.millis.toString,
- "serverTime" -> time.currentTime().millis.toString
+ "serverTime" -> currentTime.toString,
+ "uptime" -> (currentTime - startupTime.millis).toString
))
}
}
diff --git a/src/main/scala/com/drivergrp/core/rest.scala b/src/main/scala/com/drivergrp/core/rest.scala
index ebfb98e..89a0c75 100644
--- a/src/main/scala/com/drivergrp/core/rest.scala
+++ b/src/main/scala/com/drivergrp/core/rest.scala
@@ -60,7 +60,9 @@ object rest {
log.audit(s"Sending to ${request.uri} request $request")
val responseEntity = Http()(actorSystem).singleRequest(request)(materializer) map { response =>
- if(response.status.isFailure() && response.status != StatusCodes.NotFound) {
+ if(response.status == StatusCodes.NotFound) {
+ Unmarshal(HttpEntity.Empty: ResponseEntity)
+ } else if(response.status.isFailure()) {
throw new Exception("Http status is failure " + response.status)
} else {
Unmarshal(response.entity.transformDataBytes(decryptionFlow))