-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
Using PrometheusMetrics[IO]
as a dependency causes problems when compiling bootzooka:
[error] Error while emitting Dependencies.scala
[error] value x$2
[error] one error found
As a work-around, the dependency is created by hand: https://github.com/softwaremill/bootzooka/blob/tapir-update/backend/src/main/scala/com/softwaremill/bootzooka/Dependencies.scala#L36 (note that this is currently on a branch)
To reproduce, change the Dependencies
class to:
object Dependencies {
def wire(
config: Config,
sttpBackend: Resource[IO, SttpBackend[IO, Any]],
xa: Resource[IO, Transactor[IO]],
clock: Clock
): Resource[IO, Dependencies] = {
def buildHttpApi(
http: Http,
userApi: UserApi,
passwordResetApi: PasswordResetApi,
versionApi: VersionApi,
prometheusMetrics: PrometheusMetrics[IO],
cfg: HttpConfig
) = {
new HttpApi(
http,
userApi.endpoints concatNel passwordResetApi.endpoints,
NonEmptyList.of(prometheusMetrics.metricsEndpoint, versionApi.versionEndpoint),
prometheusMetrics,
cfg
)
}
autowire[Dependencies](
config.api,
config.user,
config.passwordReset,
config.email,
DefaultIdGenerator,
PrometheusMetrics.default[IO](registry = CollectorRegistry.defaultRegistry),
clock,
sttpBackend,
xa,
buildHttpApi _,
new EmailService(_, _, _, _, _),
EmailSender.create _,
new ApiKeyAuthToken(_),
new PasswordResetAuthToken(_)
)
}
}