startSchedules static method

Timer? startSchedules({
  1. Duration every = const Duration(seconds: 20),
  2. DVQueues queues = const DVQueues(),
  3. bool work = false,
})

tick every every. The generated server starts it in the process that ticks the application's schedules; with work, that process is the whole deployment and runs the jobs too.

Implementation

static Timer? startSchedules({
  Duration every = const Duration(seconds: 20),
  DVQueues queues = const DVQueues(),
  bool work = false,
}) {
  final _Runtime? runtime = _runtime;
  if (runtime == null) return null;
  runtime.works = work;
  unawaited(tick(queues: queues, work: work));
  return Timer.periodic(
    every,
    (Timer _) => unawaited(tick(queues: queues, work: work)),
  );
}