You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/12/22 03:53:32 UTC

[GitHub] [servicecomb-kie] robotLJW opened a new pull request #233: [feat] use cari package's NewTask and NewTombstone functions and chan…

robotLJW opened a new pull request #233:
URL: https://github.com/apache/servicecomb-kie/pull/233


   …ge db name in mongo model


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



[GitHub] [servicecomb-kie] little-cui commented on a change in pull request #233: [feat] use cari package's NewTask and NewTombstone functions and change db name in mongo model

Posted by GitBox <gi...@apache.org>.
little-cui commented on a change in pull request #233:
URL: https://github.com/apache/servicecomb-kie/pull/233#discussion_r773854522



##########
File path: server/datasource/etcd/kv/kv_dao.go
##########
@@ -353,16 +352,16 @@ func txnFindManyAndDelete(ctx context.Context, kvIDs []string, project, domain s
 		if kvDoc == nil {
 			continue
 		}
-		task, err := datasource.NewTask(domain, project, sync.DeleteAction, datasource.ConfigResource)
+		task, err := sync.NewTask(domain, project, sync.DeleteAction, datasource.ConfigResource)
 		if err != nil {
 			openlog.Error("fail to create task")
 			return nil, 0, err
 		}
 		docs[successKVNum] = kvDoc
 		tasks[successKVNum] = task
 		tasks[successKVNum].Data = kvDoc
-		tombstones[successKVNum] = datasource.NewTombstone(domain, project, datasource.ConfigResource)
-		tombstones[successKVNum].ResourceID = kvDoc.Key + "/" + kvDoc.LabelFormat
+		tombstones[successKVNum] = sync.NewTombstone(domain, project, datasource.ConfigResource,
+			datasource.NewCfgTombstoneID(kvDoc.Key, kvDoc.LabelFormat))

Review comment:
       这样会更好理解和扩展
   ```go
   datasource.TombstoneID(kvDoc)
   ```




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



[GitHub] [servicecomb-kie] robotLJW commented on a change in pull request #233: [feat] use cari package's NewTask and NewTombstone functions and change db name in mongo model

Posted by GitBox <gi...@apache.org>.
robotLJW commented on a change in pull request #233:
URL: https://github.com/apache/servicecomb-kie/pull/233#discussion_r774267534



##########
File path: server/datasource/etcd/kv/kv_dao.go
##########
@@ -353,16 +352,16 @@ func txnFindManyAndDelete(ctx context.Context, kvIDs []string, project, domain s
 		if kvDoc == nil {
 			continue
 		}
-		task, err := datasource.NewTask(domain, project, sync.DeleteAction, datasource.ConfigResource)
+		task, err := sync.NewTask(domain, project, sync.DeleteAction, datasource.ConfigResource)
 		if err != nil {
 			openlog.Error("fail to create task")
 			return nil, 0, err
 		}
 		docs[successKVNum] = kvDoc
 		tasks[successKVNum] = task
 		tasks[successKVNum].Data = kvDoc
-		tombstones[successKVNum] = datasource.NewTombstone(domain, project, datasource.ConfigResource)
-		tombstones[successKVNum].ResourceID = kvDoc.Key + "/" + kvDoc.LabelFormat
+		tombstones[successKVNum] = sync.NewTombstone(domain, project, datasource.ConfigResource,
+			datasource.NewCfgTombstoneID(kvDoc.Key, kvDoc.LabelFormat))

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



[GitHub] [servicecomb-kie] little-cui merged pull request #233: [feat] use cari package's NewTask and NewTombstone functions and change db name in mongo model

Posted by GitBox <gi...@apache.org>.
little-cui merged pull request #233:
URL: https://github.com/apache/servicecomb-kie/pull/233


   


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