parser: wait 2s then 5s before retrying a rate-limited 蓝奏 page

zt=4 usually clears within 2s, occasionally needs ~5s. Still two bounded
retries; a page that stays rate-limited fails with a retryable error.

Co-authored-by: qaiu <[email protected]>
This commit is contained in:
Cursor Agentandqaiu committed 2026-11-25 00:56:30 +00:00
1 parent 6ed8ae2e28
commit 1d7836c1bd
1 file changed
+6 -4
@@ -84,8 +84,9 @@ public class LzTool extends PanBase {
/** 同一组 t/k 两次 filemoreajax 间隔不足约 1.5 秒时返回 zt=4「请刷新,重试」。 */ /** 同一组 t/k 两次 filemoreajax 间隔不足约 1.5 秒时返回 zt=4「请刷新,重试」。 */
static final int LZ_ZT_REFRESH = 4; static final int LZ_ZT_REFRESH = 4;
static final long LZ_PAGE_INTERVAL_MS = 1500; static final long LZ_PAGE_INTERVAL_MS = 1500;
static final long LZ_REFRESH_RETRY_DELAY_MS = 2000; /** zt=4 时同页重试的等待时间:实测多数 2 秒内恢复,个别需要约 5 秒。 */
static final int LZ_REFRESH_RETRIES = 2; static final long[] LZ_REFRESH_RETRY_DELAYS_MS = {2000, 5000};
static final int LZ_REFRESH_RETRIES = LZ_REFRESH_RETRY_DELAYS_MS.length;
/** 无游标时从第 1 页顺序翻的最大页数,保证一次请求能在路由超时(默认 15 秒)内完成。 */ /** 无游标时从第 1 页顺序翻的最大页数,保证一次请求能在路由超时(默认 15 秒)内完成。 */
static final int LZ_MAX_WALK_PAGES = 6; static final int LZ_MAX_WALK_PAGES = 6;
/** 分享页 / ajax 请求超时 */ /** 分享页 / ajax 请求超时 */
@@ -1308,8 +1309,9 @@ public class LzTool extends PanBase {
return; return;
} }
if (reply.zt() == LZ_ZT_REFRESH && attempt < LZ_REFRESH_RETRIES) { if (reply.zt() == LZ_ZT_REFRESH && attempt < LZ_REFRESH_RETRIES) {
log.debug("蓝奏目录第 {} 页返回 {},{}ms 后重试", pg, reply.info(), LZ_REFRESH_RETRY_DELAY_MS); long delay = LZ_REFRESH_RETRY_DELAYS_MS[attempt];
WebClientVertxInit.get().setTimer(LZ_REFRESH_RETRY_DELAY_MS, log.debug("蓝奏目录第 {} 页返回 {},{}ms 后重试", pg, reply.info(), delay);
WebClientVertxInit.get().setTimer(delay,
id -> postFolderPage(sUrl, call, pg, attempt + 1, onReply, onFailure)); id -> postFolderPage(sUrl, call, pg, attempt + 1, onReply, onFailure));
return; return;
} }