Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor code hygiene #397

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/app/src/main/scala/http.middleware.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def MkMiddleware(config: HttpServerConfig)(using LoggerFactory[IO]): Middleware
def verboseLogger =
RequestLogger.httpRoutes[IO](true, true).andThen(ResponseLogger.httpRoutes[IO, Request[IO]](true, true))

val logger =
def logger =
if config.apiLogger then verboseLogger
else ApiErrorLogger.instance(using LoggerFactory[IO].getLogger)

Expand Down
4 changes: 2 additions & 2 deletions modules/app/src/main/scala/service.health.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import org.typelevel.log4cats.{ Logger, LoggerFactory }

class HealthServiceImpl(esClient: ESClient[IO])(using LoggerFactory[IO]) extends HealthService[IO]:

given logger: Logger[IO] = LoggerFactory[IO].getLogger
given Logger[IO] = LoggerFactory[IO].getLogger

override def healthCheck(): IO[HealthCheckOutput] =
esClient.status
.flatMap(transform)
.map(HealthCheckOutput(_))
.handleErrorWith: e =>
logger.error(e)("Error in health check") *>
Logger[IO].error(e)("Error in health check") *>
IO.raiseError(InternalServerError(s"Internal server error $e"))

private def transform(status: String): IO[ElasticStatus] =
Expand Down
2 changes: 1 addition & 1 deletion modules/app/src/main/scala/service.search.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SearchServiceImpl(esClient: ESClient[IO], metric: Histogram[IO, Double])(u

import SearchServiceImpl.{ *, given }

given logger: Logger[IO] = LoggerFactory[IO].getLogger
private val logger: Logger[IO] = LoggerFactory[IO].getLogger

private val baseAttributes = Attributes(Attribute("http.request.method", "POST"))
private val countMetric =
Expand Down
4 changes: 2 additions & 2 deletions smithy-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"version": "1.0",
"maven": {
"dependencies": [
"com.disneystreaming.smithy4s:smithy4s-protocol:0.18.15",
"com.disneystreaming.smithy4s:smithy4s-protocol:0.18.27",
"com.disneystreaming.alloy:alloy-core:0.3.4"
],
"repositories": []
},
"imports": [
"./src",
"modules/smithy/src/main/smithy",
"modules/smithy/target/scala-3.5.0/src_managed/main/smithy"
"modules/smithy/target/scala-3.5.2/src_managed/main/smithy"
]
}
Loading