mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
cancel installation on pending plugins
This commit is contained in:
@@ -67,7 +67,7 @@ public class InstalledPluginResource {
|
||||
})
|
||||
@TypeHint(CollectionDto.class)
|
||||
public Response updateAll(@QueryParam("restart") boolean restartAfterInstallation) {
|
||||
pluginManager.updateAll(restartAfterInstallation);
|
||||
pluginManager.updateAll();
|
||||
return Response.ok().build();
|
||||
}
|
||||
|
||||
|
||||
@@ -288,17 +288,19 @@ public class DefaultPluginManager implements PluginManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAll(boolean restartAfterInstallation) {
|
||||
public void updateAll() {
|
||||
PluginPermissions.manage().check();
|
||||
boolean pluginUpdated = false;
|
||||
|
||||
for (InstalledPlugin installedPlugin : getInstalled()) {
|
||||
String pluginName = installedPlugin.getDescriptor().getInformation().getName();
|
||||
if (isUpdatable(pluginName)) {
|
||||
install(pluginName, false);
|
||||
pluginUpdated = true;
|
||||
}
|
||||
if (restartAfterInstallation) {
|
||||
restart("update all plugin");
|
||||
}
|
||||
}
|
||||
if (pluginUpdated) {
|
||||
restart("update all plugins");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ class PendingPluginInstallation {
|
||||
LOG.info("cancel installation of plugin {}", name);
|
||||
try {
|
||||
Files.delete(file);
|
||||
plugin.cancelInstallation();
|
||||
} catch (IOException ex) {
|
||||
throw new PluginFailedToCancelInstallationException("failed to cancel installation of plugin " + name, ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user