mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
Merge pull request #6865 from zexi/hotfix/disable-inform-not-init
informer: do not inform if backend not init
This commit is contained in:
@@ -129,6 +129,9 @@ func (ts *sTableSpec) Update(ctx context.Context, dt interface{}, doUpdate func(
|
||||
}
|
||||
|
||||
func (ts *sTableSpec) inform(ctx context.Context, dt interface{}, f func(ctx context.Context, obj *informer.ModelObject) error) {
|
||||
if !informer.IsInit() {
|
||||
return
|
||||
}
|
||||
nf := func() {
|
||||
obj, err := ts.newInformerModel(dt)
|
||||
if err != nil {
|
||||
@@ -147,6 +150,9 @@ func (ts *sTableSpec) inform(ctx context.Context, dt interface{}, f func(ctx con
|
||||
}
|
||||
|
||||
func (ts *sTableSpec) informUpdate(ctx context.Context, dt interface{}, oldObj *jsonutils.JSONDict) {
|
||||
if !informer.IsInit() {
|
||||
return
|
||||
}
|
||||
nf := func() {
|
||||
obj, err := ts.newInformerModel(dt)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user