Implement storage routines for periodic scheduler

This commit is contained in:
Eike Kettner
2020-03-08 13:56:23 +01:00
parent 1e598bd902
commit 616c333fa5
7 changed files with 152 additions and 13 deletions

View File

@ -94,10 +94,12 @@ final class PeriodicSchedulerImpl[F[_]: ConcurrentEffect: ContextShift](
.takeNext(config.name)
.use({
case Some(pj) =>
(if (isTriggered(pj, now)) submitJob(pj)
else scheduleNotify(pj)).map(_ => true)
logger
.fdebug(s"Found periodic task '${pj.subject}/${pj.timer.asString}'") *>
(if (isTriggered(pj, now)) submitJob(pj)
else scheduleNotify(pj)).map(_ => true)
case None =>
false.pure[F]
logger.fdebug("No periodic task found") *> false.pure[F]
})
)
} yield go