CLI: Reduce memory usage for plugin installation (#19639)

* grafana-cli: use tmp file when downloading plugin install file
This commit is contained in:
Olivier Lemasle
2019-11-06 13:42:58 +01:00
committed by Arve Knudsen
parent 46a4118461
commit b4712ec4b9
6 changed files with 115 additions and 65 deletions

View File

@@ -1,6 +1,8 @@
package utils
import (
"os"
"github.com/codegangsta/cli"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
@@ -27,7 +29,7 @@ type CommandLine interface {
type ApiClient interface {
GetPlugin(pluginId, repoUrl string) (models.Plugin, error)
DownloadFile(pluginName, filePath, url string, checksum string) (content []byte, err error)
DownloadFile(pluginName string, tmpFile *os.File, url string, checksum string) (err error)
ListAllPlugins(repoUrl string) (models.PluginRepo, error)
}