Use job group instead of parsing the task arguments

This commit is contained in:
eikek
2021-11-07 22:39:44 +01:00
parent a09f75e45e
commit 61c01ad79b
3 changed files with 10 additions and 8 deletions

View File

@ -8,10 +8,8 @@ package docspell.restserver
import fs2.Stream
import fs2.concurrent.Topic
import docspell.backend.msg.JobDone
import docspell.common._
import docspell.common.syntax.StringSyntax._
import docspell.common.ProcessItemArgs
import docspell.pubsub.api.PubSubT
import docspell.restserver.ws.OutputEvent
@ -29,7 +27,5 @@ object Subscriptions {
pubSub
.subscribe(JobDone.topic)
.filter(m => m.body.task == ProcessItemArgs.taskName)
.map(m => m.body.args.parseJsonAs[ProcessItemArgs])
.collect { case Right(a) => OutputEvent.ItemProcessed(a.meta.collective) }
.map(m => OutputEvent.ItemProcessed(m.body.group))
}