mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-04-18 14:22:53 +00:00
fix logging issue for background execution
This commit is contained in:
parent
337b9567c6
commit
6cc2ad3a65
1 changed files with 12 additions and 0 deletions
|
|
@ -49,7 +49,18 @@ void callbackDispatcher() {
|
|||
});
|
||||
}
|
||||
|
||||
bool _isInitialized = false;
|
||||
|
||||
Future<bool> initBackgroundExecution() async {
|
||||
if (_isInitialized) {
|
||||
// Reload the users, as on Android the background isolate can
|
||||
// stay alive for multiple hours between task executions
|
||||
final user = await getUser();
|
||||
if (user == null) return false;
|
||||
gUser = user;
|
||||
return true;
|
||||
}
|
||||
|
||||
SentryWidgetsFlutterBinding.ensureInitialized();
|
||||
globalApplicationCacheDirectory = (await getApplicationCacheDirectory()).path;
|
||||
globalApplicationSupportDirectory =
|
||||
|
|
@ -65,6 +76,7 @@ Future<bool> initBackgroundExecution() async {
|
|||
apiService = ApiService();
|
||||
globalIsInBackgroundTask = true;
|
||||
|
||||
_isInitialized = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue