Dependency updates

This commit is contained in:
eikek
2022-06-13 23:11:25 +02:00
parent c130b66bbd
commit 42588593f3
6 changed files with 24 additions and 18 deletions

View File

@ -23,13 +23,19 @@ import scodec.bits.ByteVector
private[joex] class AddonPrepare[F[_]: Sync](store: Store[F]) extends LoggerExtension {
def logResult(logger: Logger[F], ref: AddonRunConfigRef): Middleware[F] =
Middleware(_.mapF(_.attempt.flatTap {
case Right(_) => ().pure[F]
case Left(ex) =>
logger
.withRunConfig(ref)
.warn(ex)(s"Addon task '${ref.id.id}' has failed")
}.rethrow))
Middleware(
_.mapF(
_.attempt
.flatTap {
case Right(_) => ().pure[F]
case Left(ex) =>
logger
.withRunConfig(ref)
.warn(ex)(s"Addon task '${ref.id.id}' has failed")
}
.rethrow
)
)
/** Creates environment variables for dsc to connect to the docspell server for the
* given run config.

View File

@ -123,7 +123,7 @@ object StringUtil {
catch { case _: NumberFormatException => ~idx }
sb.append(asInt.toChar)
end
} else ~(str.length)
} else ~str.length
}
@annotation.tailrec
def loop(idx: Int): Int =

View File

@ -163,7 +163,7 @@ final class PeriodicSchedulerImpl[F[_]: Async](
private def logThrow[A](msg: => String)(fa: F[A]): F[A] =
fa.attempt.flatMap {
case r @ Right(_) => (r: Either[Throwable, A]).pure[F]
case l @ Left(ex) => logger.error(ex)(msg).map(_ => (l: Either[Throwable, A]))
case l @ Left(ex) => logger.error(ex)(msg).map(_ => l: Either[Throwable, A])
}.rethrow
}