diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/PluginScheduledTaskUtilsCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/PluginScheduledTaskUtilsCEImpl.java index 84c32abedd..4a9f228de3 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/PluginScheduledTaskUtilsCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/PluginScheduledTaskUtilsCEImpl.java @@ -2,7 +2,6 @@ package com.appsmith.server.helpers.ce; import com.appsmith.server.configurations.CloudServicesConfig; import com.appsmith.server.domains.Plugin; -import com.appsmith.server.domains.Workspace; import com.appsmith.server.dtos.ResponseDTO; import com.appsmith.server.plugins.base.PluginService; import com.appsmith.server.services.ConfigService; @@ -86,23 +85,23 @@ public class PluginScheduledTaskUtilsCEImpl implements PluginScheduledTaskUtilsC // Save new data for this plugin, // then make sure to install to workspaces in case the default installation flag changed - final Mono> updatedPluginsWorkspaceFlux = pluginService + final Mono updatePluginsStep = pluginService .saveAll(updatablePlugins) .filter(Plugin::getDefaultInstall) .collectList() .flatMapMany(pluginService::installDefaultPlugins) - .collectList(); + .then(); // Create plugin, // then install to all workspaces if default installation is turned on - final Mono> workspaceFlux = Flux.fromIterable(insertablePlugins) + final Mono insertPluginsStep = Flux.fromIterable(insertablePlugins) .flatMap(pluginService::create) .filter(Plugin::getDefaultInstall) .collectList() .flatMapMany(pluginService::installDefaultPlugins) - .collectList(); + .then(); - return updatedPluginsWorkspaceFlux.zipWith(workspaceFlux).then(); + return updatePluginsStep.then(insertPluginsStep).then(); }); }