mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Dependency updates
This commit is contained in:
@ -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.
|
||||
|
@ -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 =
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user