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 {
  if (!configuration!.hasBeenTriggered) {
    configuration!.triggerTimestamp = DateTime.now();
    onTrigger();
  } else {
    warning(
        "$runtimeType - one time trigger already occurred at: ${configuration?.triggerTimestamp}. "
        'Will not trigger now.');
    return false;
  }
  return true;
}