onStart method

  1. @override
Future<bool> onStart()
override

Callback when this executor is started. Returns true if successfully started, false otherwise.

Implementation

@override
Future<bool> onStart() async {
  debug('creating cron job : $configuration');
  var schedule = cron.Schedule.parse(configuration!.cronExpression);
  _task = _cron.schedule(schedule, () async {
    debug('resuming cron job : ${DateTime.now().toString()}');
    onTrigger();
  });
  return true;
}