mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
fixed loadbalancer panic
This commit is contained in:
parent
e1cac9f92f
commit
d3842ec3c3
1 changed files with 2 additions and 1 deletions
|
@ -145,8 +145,9 @@ func (r *HTTPRoute) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
func (r *HTTPRoute) addToLoadBalancer() {
|
func (r *HTTPRoute) addToLoadBalancer() {
|
||||||
var lb *loadbalancer.LoadBalancer
|
var lb *loadbalancer.LoadBalancer
|
||||||
l, ok := routes.GetHTTPRoute(r.LoadBalance.Link)
|
l, ok := routes.GetHTTPRoute(r.LoadBalance.Link)
|
||||||
linked := l.(*HTTPRoute)
|
var linked *HTTPRoute
|
||||||
if ok {
|
if ok {
|
||||||
|
linked = l.(*HTTPRoute)
|
||||||
lb = linked.loadBalancer
|
lb = linked.loadBalancer
|
||||||
lb.UpdateConfigIfNeeded(r.LoadBalance)
|
lb.UpdateConfigIfNeeded(r.LoadBalance)
|
||||||
if linked.Raw.Homepage == nil && r.Raw.Homepage != nil {
|
if linked.Raw.Homepage == nil && r.Raw.Homepage != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue