From 6c73ab0d0944cc9c06de8b7877650331b34a0439 Mon Sep 17 00:00:00 2001 From: 0xcathiefish <72328723+0xcathiefish@users.noreply.github.com> Date: Sun, 5 Jul 2026 08:38:04 +0000 Subject: [PATCH] fix: raise TradeSnap request timeout from 15s to 30s The first screenshot request of each batch pays extra browser-session cleanup time in TradeSnap (~16s total), which the 15s client timeout misclassified as a failure while the capture actually succeeded. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 1 + src/notion.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a47d5d7..360bffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## [Unreleased] ### Fixed +- 将 TradeSnap 截图请求超时从 15 秒提高到 30 秒:每轮第一个截图请求(通常是 15m)需额外等待浏览器会话清理,约 16 秒完成,此前会被 15 秒超时误判为失败。 - 修复加仓成交被静默忽略的问题:开仓判断从 `start_position == 0` 改为使用 Hyperliquid 的 `dir` 字段(`Open Long` / `Open Short`),已有持仓时的加仓现在也会写入 Notion。 - 修复同一订单(`oid`)慢速多笔成交被截断的问题:聚合由「首笔成交后固定 500 毫秒窗口」改为「3 秒防抖」,每笔新成交重置计时器,静默 3 秒后才汇总发送,避免写入的数量小于实际成交量。 - `PositionTradeEvent` 现在携带真实的 `start_pos` / `end_pos`,并区分 `Open`(从零开仓)与 `Increase`(加仓)动作。 diff --git a/src/notion.rs b/src/notion.rs index 367b182..c9f6abb 100644 --- a/src/notion.rs +++ b/src/notion.rs @@ -232,7 +232,7 @@ impl NotionWriter { }; let tradesnap_url = url.trim_end_matches('/'); let http_client = reqwest::Client::builder() - .timeout(std::time::Duration::from_secs(15)) + .timeout(std::time::Duration::from_secs(30)) .build() .unwrap_or_else(|_| reqwest::Client::new()); let mut children = Vec::new();