mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: Separate manager read/write components (#50313)
* separate manager read/write * guarantee consistency in test
This commit is contained in:
@@ -358,7 +358,7 @@ func (hs *HTTPServer) InstallPlugin(c *models.ReqContext) response.Response {
|
||||
}
|
||||
pluginID := web.Params(c.Req)[":pluginId"]
|
||||
|
||||
err := hs.pluginStore.Add(c.Req.Context(), pluginID, dto.Version)
|
||||
err := hs.pluginManager.Add(c.Req.Context(), pluginID, dto.Version)
|
||||
if err != nil {
|
||||
var dupeErr plugins.DuplicateError
|
||||
if errors.As(err, &dupeErr) {
|
||||
@@ -389,7 +389,7 @@ func (hs *HTTPServer) InstallPlugin(c *models.ReqContext) response.Response {
|
||||
func (hs *HTTPServer) UninstallPlugin(c *models.ReqContext) response.Response {
|
||||
pluginID := web.Params(c.Req)[":pluginId"]
|
||||
|
||||
err := hs.pluginStore.Remove(c.Req.Context(), pluginID)
|
||||
err := hs.pluginManager.Remove(c.Req.Context(), pluginID)
|
||||
if err != nil {
|
||||
if errors.Is(err, plugins.ErrPluginNotInstalled) {
|
||||
return response.Error(http.StatusNotFound, "Plugin not installed", err)
|
||||
|
||||
Reference in New Issue
Block a user