execute method

  1. @override
Future<void> execute(
  1. LocalDatabase localDatabase
)
override

Executes the background task: upload, download, update locally.

Implementation

@override
Future<void> execute(LocalDatabase localDatabase) async {
  bool exception = false;
  try {
    await upload(localDatabase);
  } catch (e) {
    exception = true;
    rethrow;
  } finally {
    if (refreshAfterException || !exception) {
      await _downloadAndRefresh(localDatabase);
    }
  }
}