Skip to content

Commit

Permalink
feat(app): Do not wait for all jobs to complete on startup
Browse files Browse the repository at this point in the history
If we don't add the `await` keyword, the future is executed in the
background. This allows us to speed up app startup slightly.
  • Loading branch information
luckysori committed Sep 20, 2023
1 parent 76f386c commit 8fb0324
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions mobile/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,15 @@ class _TenTenOneAppState extends State<TenTenOneApp> {
await runBackend(config);
FLog.info(text: "Backend started");

await orderChangeNotifier.initialize();
await positionChangeNotifier.initialize();
await candlestickChangeNotifier.initialize();
orderChangeNotifier.initialize();
positionChangeNotifier.initialize();
candlestickChangeNotifier.initialize();

await logAppSettings(config);
logAppSettings(config);

final lastLogin = await rust.api.updateLastLogin();
FLog.debug(text: "Last login was at ${lastLogin.date}");
rust.api
.updateLastLogin()
.then((lastLogin) => FLog.debug(text: "Last login was at ${lastLogin.date}"));
} on FfiException catch (error) {
FLog.error(text: "Failed to initialise: Error: ${error.message}", exception: error);
} catch (error) {
Expand Down

0 comments on commit 8fb0324

Please sign in to comment.