瀏覽代碼

grpcproxy: forward PrevKv flag in Put

Anthony Romano 9 年之前
父節點
當前提交
6a4194c556
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      proxy/grpcproxy/kv.go

+ 3 - 0
proxy/grpcproxy/kv.go

@@ -196,6 +196,9 @@ func PutRequestToOp(r *pb.PutRequest) clientv3.Op {
 	if r.IgnoreLease {
 	if r.IgnoreLease {
 		opts = append(opts, clientv3.WithIgnoreLease())
 		opts = append(opts, clientv3.WithIgnoreLease())
 	}
 	}
+	if r.PrevKv {
+		opts = append(opts, clientv3.WithPrevKV())
+	}
 	return clientv3.OpPut(string(r.Key), string(r.Value), opts...)
 	return clientv3.OpPut(string(r.Key), string(r.Value), opts...)
 }
 }