Skip to content

Commit 0d6ccf9

Browse files
committed
Fix deployment behavior during create new web app, AB#2012020, AB#2012018
1 parent b398f89 commit 0d6ccf9

File tree

1 file changed

+8
-3
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/webapp/action

1 file changed

+8
-3
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/webapp/action/CreateWebAppAction.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.intellij.openapi.progress.ProgressManager;
1212
import com.intellij.openapi.project.Project;
1313
import com.microsoft.azure.toolkit.ide.appservice.webapp.model.WebAppConfig;
14+
import com.microsoft.azure.toolkit.intellij.common.RunProcessHandlerMessenger;
1415
import com.microsoft.azure.toolkit.intellij.legacy.webapp.WebAppCreationDialog;
1516
import com.microsoft.azure.toolkit.lib.appservice.webapp.WebApp;
1617
import com.microsoft.azure.toolkit.lib.common.action.Action;
@@ -19,6 +20,7 @@
1920
import com.microsoft.azure.toolkit.lib.common.cache.CacheManager;
2021
import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager;
2122
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
23+
import com.microsoft.azure.toolkit.lib.common.operation.OperationContext;
2224
import com.microsoft.azure.toolkit.lib.common.task.AzureTask;
2325
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
2426
import com.microsoft.azure.toolkit.lib.legacy.webapp.WebAppService;
@@ -78,22 +80,25 @@ private static Single<WebApp> createWebApp(final WebAppConfig config) {
7880

7981
@AzureOperation(name = "webapp.deploy_artifact.app", params = {"webapp.name()"}, type = AzureOperation.Type.ACTION)
8082
private static void deploy(final WebApp webapp, final Path application, final Project project) {
81-
final AzureString title = description("webapp.deploy_artifact.app", webapp.name());
83+
final AzureString title = description("webapp.deploy_artifact.app", webapp.getName());
8284
final AzureTask<Void> task = new AzureTask<>(null, title, false, () -> {
8385
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
8486
final RunProcessHandler processHandler = new RunProcessHandler();
8587
processHandler.addDefaultListener();
8688
final ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
8789
processHandler.startNotify();
8890
consoleView.attachToProcess(processHandler);
91+
92+
final RunProcessHandlerMessenger messenger = new RunProcessHandlerMessenger(processHandler);
93+
OperationContext.current().setMessager(messenger);
8994
AzureWebAppMvpModel.getInstance().deployArtifactsToWebApp(webapp, application.toFile(), true, processHandler);
9095
});
91-
AzureTaskManager.getInstance().runInModalAsObservable(task).single().subscribe((none) -> notifyDeploymentSuccess(webapp)); // let root exception handler to show the error.
96+
AzureTaskManager.getInstance().runInBackgroundAsObservable(task).single().subscribe((none) -> notifyDeploymentSuccess(webapp)); // let root exception handler to show the error.
9297
}
9398

9499
private static void notifyDeploymentSuccess(final WebApp app) {
95100
final String title = message("webapp.deploy.success.title");
96-
final String message = message("webapp.deploy.success.message", app.name());
101+
final String message = message("webapp.deploy.success.message", app.getName());
97102
AzureMessager.getMessager().success(message, title);
98103
}
99104
}

0 commit comments

Comments
 (0)