[mob] Add missing await
This commit is contained in:
@@ -145,7 +145,7 @@ Future<void> _runBackgroundTask(String taskId, {String mode = 'normal'}) async {
|
||||
if (_isProcessRunning) {
|
||||
_logger.info("Background task triggered when process was already running");
|
||||
await _sync('bgTaskActiveProcess');
|
||||
BackgroundFetch.finish(taskId);
|
||||
await BackgroundFetch.finish(taskId);
|
||||
} else {
|
||||
_runWithLogs(
|
||||
() async {
|
||||
@@ -162,7 +162,7 @@ Future<void> _runInBackground(String taskId) async {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
if (await _isRunningInForeground()) {
|
||||
_logger.info("FG task running, skipping BG taskID: $taskId");
|
||||
BackgroundFetch.finish(taskId);
|
||||
await BackgroundFetch.finish(taskId);
|
||||
return;
|
||||
} else {
|
||||
_logger.info("FG task is not running");
|
||||
@@ -182,7 +182,7 @@ Future<void> _runInBackground(String taskId) async {
|
||||
}(),
|
||||
],
|
||||
);
|
||||
BackgroundFetch.finish(taskId);
|
||||
await BackgroundFetch.finish(taskId);
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/73796478/546896
|
||||
@@ -428,7 +428,7 @@ Future<void> _killBGTask([String? taskId]) async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.remove(kLastBGTaskHeartBeatTime);
|
||||
if (taskId != null) {
|
||||
BackgroundFetch.finish(taskId);
|
||||
await BackgroundFetch.finish(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user