You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "tornado-ssy (via GitHub)" <gi...@apache.org> on 2023/12/12 16:01:03 UTC

[PR] fix the bug of do not report the error which occured in action of get kvdocs from etcd [servicecomb-kie]

tornado-ssy opened a new pull request, #305:
URL: https://github.com/apache/servicecomb-kie/pull/305

   (no comment)


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix the bug of do not report the error which occured in action of get kvdocs from etcd [servicecomb-kie]

Posted by "little-cui (via GitHub)" <gi...@apache.org>.
little-cui merged PR #305:
URL: https://github.com/apache/servicecomb-kie/pull/305


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix the bug of do not report the error which occured in action of get kvdocs from etcd [servicecomb-kie]

Posted by "little-cui (via GitHub)" <gi...@apache.org>.
little-cui commented on code in PR #305:
URL: https://github.com/apache/servicecomb-kie/pull/305#discussion_r1424251035


##########
server/datasource/etcd/kv/kv_cache.go:
##########
@@ -261,14 +264,15 @@ func Search(ctx context.Context, req *CacheSearchReq) (*model.KVResponse, bool,
 	return result, true, nil
 }
 
-func (kc *Cache) getKvFromEtcd(ctx context.Context, req *CacheSearchReq, kvIdsLeft []string) []*model.KVDoc {
+func (kc *Cache) getKvFromEtcd(ctx context.Context, req *CacheSearchReq, kvIdsLeft []string) ([]*model.KVDoc, error) {
 	if len(kvIdsLeft) == 0 {
-		return nil
+		return nil, nil
 	}
 
 	openlog.Debug("get kv from etcd by kvId")
 	wg := sync.WaitGroup{}
 	docs := make([]*model.KVDoc, len(kvIdsLeft))
+	var Err error

Review Comment:
   局部变量不应该大写命名



##########
server/datasource/etcd/kv/kv_cache.go:
##########
@@ -261,14 +264,15 @@ func Search(ctx context.Context, req *CacheSearchReq) (*model.KVResponse, bool,
 	return result, true, nil
 }
 
-func (kc *Cache) getKvFromEtcd(ctx context.Context, req *CacheSearchReq, kvIdsLeft []string) []*model.KVDoc {
+func (kc *Cache) getKvFromEtcd(ctx context.Context, req *CacheSearchReq, kvIdsLeft []string) ([]*model.KVDoc, error) {
 	if len(kvIdsLeft) == 0 {
-		return nil
+		return nil, nil
 	}
 
 	openlog.Debug("get kv from etcd by kvId")
 	wg := sync.WaitGroup{}
 	docs := make([]*model.KVDoc, len(kvIdsLeft))
+	var Err error

Review Comment:
   局部变量不应该大写命名



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org