tianxiaoliang commented on a change in pull request #800:
URL:
https://github.com/apache/servicecomb-service-center/pull/800#discussion_r549900668
##########
File path: datasource/mongo/system.go
##########
@@ -21,11 +21,23 @@ import (
"context"
"github.com/apache/servicecomb-service-center/datasource"
+ "github.com/apache/servicecomb-service-center/datasource/mongo/sd"
"github.com/apache/servicecomb-service-center/pkg/dump"
+ "github.com/apache/servicecomb-service-center/pkg/gopool"
+ "github.com/apache/servicecomb-service-center/pkg/util"
)
-func (ds *DataSource) DumpCache(ctx context.Context, cache *dump.Cache) {
+const (
+ ServiceKeyPrefix = "/cse-sr/ms/files"
Review comment:
这些常量为何不能和etcd共用
##########
File path: syncer/servicecenter/sync.go
##########
@@ -42,15 +43,22 @@ func (s *servicecenter) heartbeatInstances(mapping
pb.SyncMapping, instance *pb.
func (s *servicecenter) createService(service *pb.SyncService) string {
ctx := context.Background()
- serviceID, _ := s.servicecenter.ServiceExistence(ctx,
service.DomainProject, service)
+ serviceID, err := s.servicecenter.ServiceExistence(ctx,
service.DomainProject, service)
+ if err != nil {
+ log.Error("Get service existence failed", err)
+ return ""
+ }
+
if serviceID == "" {
var err error
serviceID, err = s.servicecenter.CreateService(ctx,
service.DomainProject, service)
if err != nil {
- log.Errorf(err, "Servicecenter create service failed")
+ log.Error("Servicecenter create service failed", err)
Review comment:
go的日志开头不能是大写,都是小写,而且主语是一个废话
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]