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

Fixes #8209
This commit is contained in:
Todd Volkert
2017-02-16 16:46:38 -08:00
committed by GitHub
parent 90574b0478
commit b59982eccd
2 changed files with 5 additions and 5 deletions

View File

@@ -310,7 +310,7 @@ class AppDomain extends Domain {
BuildMode buildMode = getBuildModeForName(mode) ?? BuildMode.debug;
AppInstance app = startApp(
AppInstance app = await startApp(
device, projectDirectory, target, route,
buildMode, startPaused, enableHotReload);
@@ -322,14 +322,14 @@ class AppDomain extends Domain {
};
}
AppInstance startApp(
Future<AppInstance> startApp(
Device device, String projectDirectory, String target, String route,
BuildMode buildMode, bool startPaused, bool enableHotReload, {
String applicationBinary,
String projectRootPath,
String packagesFilePath,
String projectAssets,
}) {
}) async {
DebuggingOptions options;
switch (buildMode) {
@@ -401,7 +401,7 @@ class AppDomain extends Domain {
_sendAppEvent(app, 'started');
});
app._runInZone(this, () async {
await app._runInZone(this, () async {
try {
await runner.run(
connectionInfoCompleter: connectionInfoCompleter,

View File

@@ -213,7 +213,7 @@ class RunCommand extends RunCommandBase {
notifyingLogger: new NotifyingLogger(), logToStdout: true);
AppInstance app;
try {
app = daemon.appDomain.startApp(
app = await daemon.appDomain.startApp(
device, fs.currentDirectory.path, targetFile, route,
getBuildMode(), argResults['start-paused'], hotMode,
applicationBinary: argResults['use-application-binary'],