Adopt modules to new collective table

This commit is contained in:
eikek
2022-07-13 23:37:46 +02:00
parent 77f22bb5ea
commit 26d7c91266
11 changed files with 113 additions and 64 deletions

View File

@ -0,0 +1,19 @@
package docspell.scheduler
import cats.Applicative
import docspell.common.AccountInfo
/** Strategy to find the user that submitted the job. This is used to emit events about
* starting/finishing jobs.
*
* If an account cannot be determined, no events can be send.
*/
trait FindJobOwner[F[_]] {
def apply(job: Job[_]): F[Option[AccountInfo]]
}
object FindJobOwner {
def none[F[_]: Applicative]: FindJobOwner[F] =
(_: Job[_]) => Applicative[F].pure(None)
}