execute method
- 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);
}
}
}