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