mirror of
				https://github.com/TheAnachronism/docspell.git
				synced 2025-11-04 12:30:12 +00:00 
			
		
		
		
	Merge pull request #939 from eikek/fix/938-submit-multiple-files
The id must be recreated for each job, obviously
This commit is contained in:
		@@ -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
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user