Skip to content

Commit 677ffe0

Browse files
Copilotbinarywang
andcommitted
改进代码注释的准确性和完整性
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
1 parent c23b540 commit 677ffe0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/config/impl/WxCpRedisConfigImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public class WxCpRedisConfigImpl implements WxCpConfigStorage {
6262
private volatile int msgAuditSdkRefCount;
6363
/**
6464
* 会话存档access token锁(本地锁,不支持分布式)
65+
* 注意:此实现使用本地ReentrantLock,在多实例部署时无法保证跨JVM的同步
66+
* 建议在生产环境中自行实现分布式锁机制,或使用其他支持分布式的配置存储实现
6567
*/
6668
private final Lock msgAuditAccessTokenLock = new ReentrantLock();
6769

weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpServiceGetMsgAuditAccessTokenTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public String getMsgAuditAccessToken(boolean forceRefresh) throws WxErrorExcepti
141141
throw new WxErrorException("会话存档secret未配置");
142142
}
143143

144-
// 模拟HTTP请求失败,实际测试中应该返回缓存的token
144+
// 返回缓存的token(用于测试缓存机制)
145145
return getWxCpConfigStorage().getMsgAuditAccessToken();
146146
}
147147

0 commit comments

Comments
 (0)