mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
merge 2.0.0 / rename installPending to executePending
This commit is contained in:
@@ -72,7 +72,7 @@ public class PendingPluginResource {
|
||||
List<PluginDto> uninstallDtos = uninstallPlugins.map(i -> mapper.mapInstalled(i, pending)).collect(toList());
|
||||
|
||||
if (!installDtos.isEmpty() || !updateDtos.isEmpty() || !uninstallDtos.isEmpty()) {
|
||||
linksBuilder.single(link("install", resourceLinks.pendingPluginCollection().installPending()));
|
||||
linksBuilder.single(link("execute", resourceLinks.pendingPluginCollection().executePending()));
|
||||
}
|
||||
|
||||
Embedded.Builder embedded = Embedded.embeddedBuilder();
|
||||
@@ -100,14 +100,14 @@ public class PendingPluginResource {
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/install")
|
||||
@Path("/execute")
|
||||
@StatusCodes({
|
||||
@ResponseCode(code = 200, condition = "success"),
|
||||
@ResponseCode(code = 500, condition = "internal server error")
|
||||
})
|
||||
public Response installPending() {
|
||||
public Response executePending() {
|
||||
PluginPermissions.manage().check();
|
||||
pluginManager.installPendingAndRestart();
|
||||
pluginManager.executePendingAndRestart();
|
||||
return Response.ok().build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,8 +735,8 @@ class ResourceLinks {
|
||||
pendingPluginCollectionLinkBuilder = new LinkBuilder(pathInfo, PluginRootResource.class, PendingPluginResource.class);
|
||||
}
|
||||
|
||||
String installPending() {
|
||||
return pendingPluginCollectionLinkBuilder.method("pendingPlugins").parameters().method("installPending").parameters().href();
|
||||
String executePending() {
|
||||
return pendingPluginCollectionLinkBuilder.method("pendingPlugins").parameters().method("executePending").parameters().href();
|
||||
}
|
||||
|
||||
String self() {
|
||||
|
||||
@@ -220,10 +220,10 @@ public class DefaultPluginManager implements PluginManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void installPendingAndRestart() {
|
||||
public void executePendingAndRestart() {
|
||||
PluginPermissions.manage().check();
|
||||
if (!pendingQueue.isEmpty()) {
|
||||
restart("install pending plugins");
|
||||
restart("execute pending plugin changes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ class PluginCenterLoader {
|
||||
LOG.info("fetch plugins from {}", url);
|
||||
PluginCenterDto pluginCenterDto = client.get(url).request().contentFromJson(PluginCenterDto.class);
|
||||
return mapper.map(pluginCenterDto);
|
||||
} catch (IOException ex) {
|
||||
LOG.error("failed to load plugins from plugin center, returning empty list");
|
||||
} catch (Exception ex) {
|
||||
LOG.error("failed to load plugins from plugin center, returning empty list", ex);
|
||||
return Collections.emptySet();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user