Retry sync when a background task is executed within the same isolate
This commit is contained in:
parent
0ebfe2760e
commit
506dc2af73
|
@ -66,9 +66,15 @@ Future<void> _runInForeground() async {
|
|||
}
|
||||
|
||||
Future<void> _runBackgroundTask(String taskId) async {
|
||||
if (Platform.isIOS && _isProcessRunning) {
|
||||
_logger.info("Background task triggered when process was already running");
|
||||
await _sync();
|
||||
BackgroundFetch.finish(taskId);
|
||||
} else {
|
||||
_runWithLogs(() async {
|
||||
_runInBackground(taskId);
|
||||
}, prefix: "[bg]");
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _runInBackground(String taskId) async {
|
||||
|
|
Loading…
Reference in a new issue