forked from coop-cloud/abra
fix: use appFiles to determine server list
This commit is contained in:
parent
bd1bf3b0d6
commit
95a9013658
|
@ -278,14 +278,20 @@ func SanitiseAppName(name string) string {
|
|||
func GetAppStatuses(appFiles AppFiles) (map[string]string, error) {
|
||||
statuses := map[string]string{}
|
||||
|
||||
servers, err := GetServers()
|
||||
if err != nil {
|
||||
return statuses, err
|
||||
var unique []string
|
||||
servers := make(map[string]struct{})
|
||||
for _, appFile := range appFiles {
|
||||
if _, ok := servers[appFile.Server]; !ok {
|
||||
servers[appFile.Server] = struct{}{}
|
||||
unique = append(unique, appFile.Server)
|
||||
}
|
||||
}
|
||||
|
||||
ch := make(chan stack.StackStatus, len(servers))
|
||||
for _, server := range servers {
|
||||
go func(s string) { ch <- stack.GetAllDeployedServices(s) }(server)
|
||||
for server := range servers {
|
||||
go func(s string) {
|
||||
ch <- stack.GetAllDeployedServices(s)
|
||||
}(server)
|
||||
}
|
||||
|
||||
for range servers {
|
||||
|
|
Loading…
Reference in New Issue