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 {
  _timer = Timer.periodic(Duration(minutes: 1), (_) {
    print(AppTaskController().userTaskQueue);
    if (!AppTaskController()
        .userTaskQueue
        .where((task) => task.state == UserTaskState.enqueued)
        .any((task) => task.name == configuration!.taskName)) {
      onTrigger();
    }
  });

  return true;
}