Skip to content

Commit

Permalink
Merge branch 'develop' into 4-update-extracted-features-api-queries-b…
Browse files Browse the repository at this point in the history
…ased-on-newly-ingested-aggregate-data
  • Loading branch information
sandeep-ps authored May 20, 2024
2 parents e654808 + a685b82 commit f7e233a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: scalacenter/sbt-dependency-submission@v2
- uses: scalacenter/sbt-dependency-submission@v3
2 changes: 1 addition & 1 deletion app/controllers/HealthController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HealthController @Inject()(reactiveMongoApi: ReactiveMongoApi, components:

def livenessCheck: Action[AnyContent] = Action { Ok }

def readynessCheck: Action[AnyContent] =
def readinessCheck: Action[AnyContent] =
Action.async { _ =>
reactiveMongoApi.database.flatMap(runPing).transform {
case Success(true) => Success(Ok)
Expand Down
25 changes: 25 additions & 0 deletions app/filters/LoggingFilter.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package filters

import akka.stream.Materializer
import play.api.Logging
import play.api.mvc._

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}

class LoggingFilter @Inject()(implicit override val mat: Materializer, ec: ExecutionContext) extends Filter with Logging {
def apply(nextFilter: RequestHeader => Future[Result])(requestHeader: RequestHeader): Future[Result] = {
val startTime = System.currentTimeMillis

nextFilter(requestHeader).map { result =>
val endTime = System.currentTimeMillis
val requestTime = endTime - startTime

logger.info(
s"${requestHeader.method} ${requestHeader.uri} took ${requestTime}ms and returned ${result.header.status}"
)

result
}
}
}
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ lazy val dockerSettings = Seq(
dockerRepository := Some("docker.htrc.illinois.edu"),
dockerUpdateLatest := true,
Universal / javaOptions ++= Seq(
"-J-Xmx8G",
"-J-Xss1M",
// don't write any pid files
"-Dpidfile.path=/dev/null",
// reference a logback config file that has no file appenders
Expand Down
1 change: 1 addition & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ play.filters {
enabled += play.filters.cors.CORSFilter
enabled += play.filters.gzip.GzipFilter
enabled += filters.InfoFilter
enabled += filters.LoggingFilter

disabled += play.filters.hosts.AllowedHostsFilter
disabled += play.filters.headers.SecurityHeadersFilter
Expand Down
2 changes: 1 addition & 1 deletion conf/logback-prod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<logger name="com.avaje.ebeaninternal.server.lib.BackgroundThread" level="OFF" />
<logger name="com.gargoylesoftware.htmlunit.javascript" level="OFF" />

<root level="WARN">
<root level="INFO">
<appender-ref ref="ASYNCSTDOUT" />
</root>

Expand Down
2 changes: 1 addition & 1 deletion conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<logger name="com.avaje.ebeaninternal.server.lib.BackgroundThread" level="OFF" />
<logger name="com.gargoylesoftware.htmlunit.javascript" level="OFF" />

<root level="WARN">
<root level="INFO">
<appender-ref ref="ASYNCFILE" />
<appender-ref ref="ASYNCSTDOUT" />
</root>
Expand Down
2 changes: 1 addition & 1 deletion conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GET /assets/*file controllers.Assets.versioned(path = "/public
#GET /swagger.json controllers.Assets.at(path = "/public", file = "swagger.json")

GET /health/liveness controllers.HealthController.livenessCheck
GET /health/readiness controllers.HealthController.readynessCheck
GET /health/readiness controllers.HealthController.readinessCheck

GET /volumes/:cleanId controllers.EfController.getVolume(cleanId, pos: Boolean ?= true, fields: Option[String] ?= None)
HEAD /volumes/:cleanId controllers.EfController.checkVolume(cleanId)
Expand Down

0 comments on commit f7e233a

Please sign in to comment.