mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-29 17:48:50 +08:00
🎨 规范lock.lock()代码,统一放在try代码块之外
Co-authored-by: 谢炳庭 <xiebingting@xiongmaocar.com>
This commit is contained in:
@ -33,8 +33,8 @@ public class WxMaJsapiServiceImpl implements WxMaJsapiService {
|
||||
@Override
|
||||
public String getCardApiTicket(boolean forceRefresh) throws WxErrorException {
|
||||
Lock lock = this.wxMaService.getWxMaConfig().getCardApiTicketLock();
|
||||
lock.lock();
|
||||
try {
|
||||
lock.lock();
|
||||
if (forceRefresh) {
|
||||
this.wxMaService.getWxMaConfig().expireCardApiTicket();
|
||||
}
|
||||
@ -60,8 +60,8 @@ public class WxMaJsapiServiceImpl implements WxMaJsapiService {
|
||||
@Override
|
||||
public String getJsapiTicket(boolean forceRefresh) throws WxErrorException {
|
||||
Lock lock = this.wxMaService.getWxMaConfig().getJsapiTicketLock();
|
||||
lock.lock();
|
||||
try {
|
||||
lock.lock();
|
||||
if (forceRefresh) {
|
||||
this.wxMaService.getWxMaConfig().expireJsapiTicket();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user