findMissedTasks function

List<CronTask> findMissedTasks(
  1. List<CronTask> tasks,
  2. int nowMs
)

A task is "missed" when its next scheduled run (computed from createdAt) is in the past.

Implementation

List<CronTask> findMissedTasks(List<CronTask> tasks, int nowMs) {
  return tasks.where((t) {
    final next = nextCronRunMs(t.cron, t.createdAt);
    return next != null && next < nowMs;
  }).toList();
}