Commit d6f6a270 by 刘鹏飞

下单锁定的key设置默认时间

parent fdb9daa6
......@@ -62,7 +62,7 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
/**
* 创单锁定的key
*/
@Value("${create.order.key.expire}")
@Value("${create.order.key.expire:5}")
private String createOrderKeyExpire;
@Autowired
......@@ -145,7 +145,7 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
// 锁定秒数从apollo获取,如果apollo没有设置,默认5秒
String createOrderKey = CREATE_ORDER_KEY + assortmentCustomerInfoVo.getMemberId();
try {
Long expire = StringUtils.isNotBlank(createOrderKeyExpire) ? Long.valueOf(createOrderKeyExpire) : 5L;
Long expire = Long.valueOf(createOrderKeyExpire);
if(!LockUtils.lock(redisCache.getRedisTemplate(),createOrderKey,expire)){
return ResponseUtil.error(ResponseResult.ORDER_NOT_CREATE_ERROR);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment