Commit 0fcc0c3c authored by matianhao's avatar matianhao

[瑞成接口] <fix> 放大重新请求限制次数

parent 76492aec
......@@ -44,6 +44,8 @@ public class RestTemplateService {
private ThreadLocal<Integer> threadLocal = ThreadLocal.withInitial(() -> 0);
private static final Integer REQUEST_LIMIT = 20;
@Value("${ruicheng.address}")
private String pathUrl;
......@@ -115,8 +117,8 @@ public class RestTemplateService {
Integer count = threadLocal.get();
String threadName = Thread.currentThread().getName();
// 如非成功返回码,则重新获取秘钥并发送请求,限制重新请求次数两次
if (!RESPONSE_CODE_00.equals(code) && count < 2) {
// 如非成功返回码,则重新获取秘钥并发送请求,限制重新请求次数
if (!RESPONSE_CODE_00.equals(code) && count < REQUEST_LIMIT) {
threadLocal.set(++count);
log.info("线程名称:{},重新请求次数:{}", threadName, count);
// redis 中获取过期时间
......
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