refactor: parallelize report commands

This will make reports a bit faster to run, and is safe to do as reports should not change app state.
This commit is contained in:
Jose Diaz-Gonzalez committed 2020-12-29 23:56:10 -05:00
1 parent 44461e21df
commit 28c9f42a25
9 files changed
+237 -120

No files matched your search

-27
View File
@@ -1,27 +0,0 @@
package buildpacks
import (
"strings"
"github.com/dokku/dokku/plugins/common"
)
// ReportSingleApp is an internal function that displays the app report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
if err != nil {
return err
}
infoFlags := map[string]string{
"--buildpacks-list": strings.Join(buildpacks, ","),
}
trimPrefix := false
uppercaseFirstCharacter := true
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
}