scheduleRetry method

void scheduleRetry(
  1. LocusErrorType errorType,
  2. void retryAction()
)

Schedules a retry with appropriate delay.

Implementation

void scheduleRetry(
  LocusErrorType errorType,
  void Function() retryAction,
) {
  final delay = getRetryDelay(errorType);
  _retryTimers[errorType]?.cancel();
  _retryTimers[errorType] = Timer(delay, () {
    _retryTimers.remove(errorType);
    retryAction();
  });
}