mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
ScalafmtAll
This commit is contained in:
@ -2,7 +2,7 @@ package docspell.common
|
||||
|
||||
object DocspellSystem {
|
||||
|
||||
val taskGroup = Ident.unsafe("docspell-system")
|
||||
val taskGroup = Ident.unsafe("docspell-system")
|
||||
val migrationTaskTracker = Ident.unsafe("full-text-index-tracker")
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ case class Ident(id: String) {
|
||||
def nonEmpty: Boolean =
|
||||
!isEmpty
|
||||
|
||||
def / (next: Ident): Ident =
|
||||
def /(next: Ident): Ident =
|
||||
new Ident(id + "." + next.id)
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@ object SolrUpdate {
|
||||
.withQueryParam("overwrite", "true")
|
||||
.withQueryParam("wt", "json")
|
||||
|
||||
|
||||
def add(tds: List[TextData]): F[Unit] = {
|
||||
val req = Method.POST(tds.asJson, url)
|
||||
client.expect[String](req).map(r => logger.debug(s"Req: $req Response: $r"))
|
||||
@ -59,16 +58,16 @@ object SolrUpdate {
|
||||
td.name.isDefined || td.notes.isDefined
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case class Delete(query: String)
|
||||
object Delete {
|
||||
implicit val jsonEncoder: Encoder[Delete] =
|
||||
new Encoder[Delete] {
|
||||
def apply(d: Delete): Json =
|
||||
Json.obj(
|
||||
("delete", Json.obj("query" -> d.query.asJson))
|
||||
)
|
||||
}
|
||||
}
|
||||
case class Delete(query: String)
|
||||
object Delete {
|
||||
implicit val jsonEncoder: Encoder[Delete] =
|
||||
new Encoder[Delete] {
|
||||
def apply(d: Delete): Json =
|
||||
Json.obj(
|
||||
("delete", Json.obj("query" -> d.query.asJson))
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import docspell.ftsclient._
|
||||
import docspell.store.records.RJob
|
||||
|
||||
object MigrationTask {
|
||||
val taskName = Ident.unsafe("full-text-index")
|
||||
val taskName = Ident.unsafe("full-text-index")
|
||||
|
||||
def apply[F[_]: ConcurrentEffect](
|
||||
cfg: Config.FullTextSearch,
|
||||
|
@ -17,7 +17,8 @@ object ItemHandler {
|
||||
)
|
||||
|
||||
def newItem[F[_]: ConcurrentEffect: ContextShift](
|
||||
cfg: Config, fts: FtsClient[F]
|
||||
cfg: Config,
|
||||
fts: FtsClient[F]
|
||||
): Task[F, ProcessItemArgs, Unit] =
|
||||
CreateItem[F]
|
||||
.flatMap(itemStateTask(ItemState.Processing))
|
||||
@ -37,7 +38,8 @@ object ItemHandler {
|
||||
Task(_.isLastRetry)
|
||||
|
||||
def safeProcess[F[_]: ConcurrentEffect: ContextShift](
|
||||
cfg: Config, fts: FtsClient[F]
|
||||
cfg: Config,
|
||||
fts: FtsClient[F]
|
||||
)(data: ItemData): Task[F, ProcessItemArgs, ItemData] =
|
||||
isLastRetry[F].flatMap {
|
||||
case true =>
|
||||
|
@ -10,7 +10,8 @@ import docspell.ftsclient.FtsClient
|
||||
object ProcessItem {
|
||||
|
||||
def apply[F[_]: ConcurrentEffect: ContextShift](
|
||||
cfg: Config, fts: FtsClient[F]
|
||||
cfg: Config,
|
||||
fts: FtsClient[F]
|
||||
)(item: ItemData): Task[F, ProcessItemArgs, ItemData] =
|
||||
ExtractArchive(item)
|
||||
.flatMap(Task.setProgress(20))
|
||||
|
Reference in New Issue
Block a user