Refresh item after addon is done

This commit is contained in:
eikek
2022-05-18 00:23:46 +02:00
parent 5abbe92f2b
commit 29a5894884
15 changed files with 123 additions and 19 deletions

View File

@ -10,7 +10,7 @@ import docspell.common._
import docspell.pubsub.api.{Topic, TypedTopic}
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}
import io.circe.{Decoder, Encoder}
import io.circe.{Decoder, Encoder, Json}
/** Message to notify about finished jobs. They have a final state. */
final case class JobDone(
@ -18,7 +18,8 @@ final case class JobDone(
group: Ident,
task: Ident,
args: String,
state: JobState
state: JobState,
result: Option[Json]
)
object JobDone {
implicit val jsonDecoder: Decoder[JobDone] =

View File

@ -231,7 +231,7 @@ final class SchedulerImpl[F[_]: Async](
_ <- Sync[F].whenA(JobState.isDone(finishState))(
pubSub.publish1IgnoreErrors(
JobDone.topic,
JobDone(job.id, job.group, job.task, job.args, finishState)
JobDone(job.id, job.group, job.task, job.args, finishState, result.json)
)
)
_ <- Sync[F].whenA(JobState.isDone(finishState))(