Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: use hget replace hmget because only one field #4761

Merged
merged 10 commits into from Aug 1, 2022
1 change: 1 addition & 0 deletions changes/en-us/develop.md
Expand Up @@ -16,6 +16,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#4750](https://github.com/seata/seata/pull/4750)] optimize unBranchLock romove xid
- [[#4797](https://github.com/seata/seata/pull/4797)] optimize the github actions
- [[#4800](https://github.com/seata/seata/pull/4800)] Add NOTICE as Apache License V2
- [[#4761](https://github.com/seata/seata/pull/4761)] use hget replace hmget because only one field

### test:
- [[#4794](https://github.com/seata/seata/pull/4794)] try to fix the test `DataSourceProxyTest.getResourceIdTest()`
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/develop.md
Expand Up @@ -16,6 +16,7 @@
- [[#4765](https://github.com/seata/seata/pull/4765)] mysql8.0.29版本及以上XA模式不持connection至二阶段
- [[#4797](https://github.com/seata/seata/pull/4797)] 优化所有github actions脚本
- [[#4800](https://github.com/seata/seata/pull/4800)] 按照 Apache 协议规范,添加 NOTICE 文件
- [[#4761](https://github.com/seata/seata/pull/4761)] 使用 hget 代替 RedisLocker 中的 hmget, 因为只有一个 field

### test:
- [[#4794](https://github.com/seata/seata/pull/4794)] 重构代码,尝试修复单元测试 `DataSourceProxyTest.getResourceIdTest()`
Expand Down
Expand Up @@ -359,7 +359,7 @@ private boolean doReleaseLock(String xid, Long branchId) {
Map<String, String> rowKeyMap = jedis.hgetAll(xidLockKey);
rowKeyMap.forEach((branch, rowKey) -> rowKeys.add(rowKey));
} else {
rowKeys.addAll(jedis.hmget(xidLockKey, branchId.toString()));
rowKeys.add(jedis.hget(xidLockKey, branchId.toString()));
}
if (CollectionUtils.isNotEmpty(rowKeys)) {
Pipeline pipelined = jedis.pipelined();
Expand Down