Commit b59982ec authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Properly await future when starting app in daemon mode (#8227)

Fixes #8209
parent 90574b04
...@@ -310,7 +310,7 @@ class AppDomain extends Domain { ...@@ -310,7 +310,7 @@ class AppDomain extends Domain {
BuildMode buildMode = getBuildModeForName(mode) ?? BuildMode.debug; BuildMode buildMode = getBuildModeForName(mode) ?? BuildMode.debug;
AppInstance app = startApp( AppInstance app = await startApp(
device, projectDirectory, target, route, device, projectDirectory, target, route,
buildMode, startPaused, enableHotReload); buildMode, startPaused, enableHotReload);
...@@ -322,14 +322,14 @@ class AppDomain extends Domain { ...@@ -322,14 +322,14 @@ class AppDomain extends Domain {
}; };
} }
AppInstance startApp( Future<AppInstance> startApp(
Device device, String projectDirectory, String target, String route, Device device, String projectDirectory, String target, String route,
BuildMode buildMode, bool startPaused, bool enableHotReload, { BuildMode buildMode, bool startPaused, bool enableHotReload, {
String applicationBinary, String applicationBinary,
String projectRootPath, String projectRootPath,
String packagesFilePath, String packagesFilePath,
String projectAssets, String projectAssets,
}) { }) async {
DebuggingOptions options; DebuggingOptions options;
switch (buildMode) { switch (buildMode) {
...@@ -401,7 +401,7 @@ class AppDomain extends Domain { ...@@ -401,7 +401,7 @@ class AppDomain extends Domain {
_sendAppEvent(app, 'started'); _sendAppEvent(app, 'started');
}); });
app._runInZone(this, () async { await app._runInZone(this, () async {
try { try {
await runner.run( await runner.run(
connectionInfoCompleter: connectionInfoCompleter, connectionInfoCompleter: connectionInfoCompleter,
......
...@@ -213,7 +213,7 @@ class RunCommand extends RunCommandBase { ...@@ -213,7 +213,7 @@ class RunCommand extends RunCommandBase {
notifyingLogger: new NotifyingLogger(), logToStdout: true); notifyingLogger: new NotifyingLogger(), logToStdout: true);
AppInstance app; AppInstance app;
try { try {
app = daemon.appDomain.startApp( app = await daemon.appDomain.startApp(
device, fs.currentDirectory.path, targetFile, route, device, fs.currentDirectory.path, targetFile, route,
getBuildMode(), argResults['start-paused'], hotMode, getBuildMode(), argResults['start-paused'], hotMode,
applicationBinary: argResults['use-application-binary'], applicationBinary: argResults['use-application-binary'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment