mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
Merge pull request #1939 from yousong/bugfix/yousong-lbbackends-loglines
lbbackends: 若backend guest已删除getVpc返回空且不报错
This commit is contained in:
@@ -16,6 +16,7 @@ package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -362,7 +363,10 @@ func (lbb *SLoadbalancerBackend) getVpc(ctx context.Context) (*SVpc, error) {
|
||||
}
|
||||
guestM, err := GuestManager.FetchById(lbb.BackendId)
|
||||
if err != nil {
|
||||
theLbbJanitor.Signal()
|
||||
if err == sql.ErrNoRows {
|
||||
theLbbJanitor.Signal()
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.WithMessagef(err, "find guest %s", lbb.BackendId)
|
||||
}
|
||||
guest := guestM.(*SGuest)
|
||||
|
||||
Reference in New Issue
Block a user