mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-21 14:26:30 -04:00
admin,templates,core: Minor enhancements and error handling (#3607)
* fix 2 possible bugs * handle unhandled errors
This commit is contained in:
@@ -401,6 +401,9 @@ func leastRequests(upstreams []*Upstream) *Upstream {
|
||||
best = append(best, upstream)
|
||||
}
|
||||
}
|
||||
if len(best) == 0 {
|
||||
return nil
|
||||
}
|
||||
return best[weakrand.Intn(len(best))]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user