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:
@@ -12,16 +12,21 @@ func ReportSingleApp(appName, infoFlag string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
infoFlags := map[string]string{
|
||||
"--buildpacks-list": strings.Join(buildpacks, ","),
|
||||
flags := map[string]common.ReportFunc{
|
||||
"--buildpacks-list": reportList,
|
||||
}
|
||||
|
||||
trimPrefix := false
|
||||
uppercaseFirstCharacter := true
|
||||
infoFlags := common.CollectReport(appName, flags)
|
||||
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
|
||||
}
|
||||
|
||||
func reportList(appName string) string {
|
||||
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return strings.Join(buildpacks, ",")
|
||||
}
|
||||
Reference in New Issue
Block a user