|
@@ -7,10 +7,15 @@ export async function tryLimit({ action, limit = 100 }) {
|
|
|
try {
|
|
|
res = await axios.get(
|
|
|
`https://tcc.qmth.com.cn/rate_limit/prod/${action}/${limit}`,
|
|
|
- { timeout: 5 * 1000 }
|
|
|
+ { timeout: 10 * 1000 }
|
|
|
);
|
|
|
serverPass = res.data.pass;
|
|
|
|
|
|
+ createLog({
|
|
|
+ action: "第一次限流调用",
|
|
|
+ limitAction: action,
|
|
|
+ detail: serverPass ? "进入" : "限流",
|
|
|
+ });
|
|
|
if (!serverPass) {
|
|
|
// 休眠 1 ~ 5 秒 再试
|
|
|
res = null; // 供外部判断
|
|
@@ -21,7 +26,7 @@ export async function tryLimit({ action, limit = 100 }) {
|
|
|
console.log({ sleepTime, now: Date.now() });
|
|
|
res = await axios.get(
|
|
|
`https://tcc.qmth.com.cn/rate_limit/prod/${action}/${limit}`,
|
|
|
- { timeout: 5 * 1000 }
|
|
|
+ { timeout: 10 * 1000 }
|
|
|
);
|
|
|
serverPass = res.data.pass;
|
|
|
createLog({
|