Skip to content

Commit

Permalink
remove informer code for release/3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed Jul 13, 2020
1 parent 99caf7b commit a365a0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/cloudcommon/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import (
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/db/lockman"
"yunion.io/x/onecloud/pkg/cloudcommon/etcd"
"yunion.io/x/onecloud/pkg/cloudcommon/informer"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
)

Expand Down Expand Up @@ -80,6 +78,7 @@ func InitDB(options *common_options.DBOptions) {
}
// lm := lockman.NewNoopLockManager()

/* disable informer feature on release/3.3
if len(options.EtcdEndpoints) != 0 {
log.Infof("using etcd as resource informer backend")
tlsCfg, err := options.GetEtcdTLSConfig()
Expand All @@ -99,6 +98,7 @@ func InitDB(options *common_options.DBOptions) {
}
informer.Init(informerBackend)
}
*/
}

func CloseDB() {
Expand Down
11 changes: 6 additions & 5 deletions pkg/keystone/models/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ func (manager *SEndpointManager) InitializeData() error {
})
}
}
if err := manager.SetInformerBackend(); err != nil {
log.Errorf("init informer backend error: %v", err)
}
/*
if err := manager.SetInformerBackend(); err != nil {
log.Errorf("init informer backend error: %v", err)
}*/
return nil
}

Expand Down Expand Up @@ -591,14 +592,14 @@ func (endpoint *SEndpoint) PostCreate(ctx context.Context, userCred mcclient.Tok
endpoint.SStandaloneResourceBase.PostCreate(ctx, userCred, ownerId, query, data)
logclient.AddActionLogWithContext(ctx, endpoint, logclient.ACT_CREATE, data, userCred, true)
refreshDefaultClientServiceCatalog()
endpoint.trySetInformerBackend()
//endpoint.trySetInformerBackend()
}

func (endpoint *SEndpoint) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) {
endpoint.SStandaloneResourceBase.PostUpdate(ctx, userCred, query, data)
logclient.AddActionLogWithContext(ctx, endpoint, logclient.ACT_UPDATE, data, userCred, true)
refreshDefaultClientServiceCatalog()
endpoint.trySetInformerBackend()
//endpoint.trySetInformerBackend()
}

func (endpoint *SEndpoint) PostDelete(ctx context.Context, userCred mcclient.TokenCredential) {
Expand Down

0 comments on commit a365a0f

Please sign in to comment.