The id must be recreated for each job, obviously

Fixes: #938
This commit is contained in:
eikek 2021-07-16 21:14:47 +02:00
parent 280968355e
commit 1913877de1

View File

@ -145,23 +145,26 @@ object JobFactory {
prio: Priority, prio: Priority,
tracker: Option[Ident] tracker: Option[Ident]
): F[Vector[RJob]] = { ): F[Vector[RJob]] = {
def create(id: Ident, now: Timestamp, arg: ProcessItemArgs): RJob = def create(now: Timestamp, arg: ProcessItemArgs): F[RJob] =
RJob.newJob( Ident
id, .randomId[F]
ProcessItemArgs.taskName, .map(id =>
account.collective, RJob.newJob(
arg, id,
arg.makeSubject, ProcessItemArgs.taskName,
now, account.collective,
account.user, arg,
prio, arg.makeSubject,
tracker now,
) account.user,
prio,
tracker
)
)
for { for {
id <- Ident.randomId[F] now <- Timestamp.current[F]
now <- Timestamp.current[F] jobs <- args.traverse(a => create(now, a))
jobs = args.map(a => create(id, now, a))
} yield jobs } yield jobs
} }