mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-03 18:53:27 +08: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