fix: reqwest Client添加10s超时防止登录请求挂起阻塞worker

This commit is contained in:
2026-06-09 15:44:48 +08:00
parent b54a9d8131
commit 2aea682098

View File

@@ -239,7 +239,11 @@ async fn main() -> std::io::Result<()> {
} }
}; };
let http_client = Client::new(); let http_client = Client::builder()
.timeout(std::time::Duration::from_secs(10))
.connect_timeout(std::time::Duration::from_secs(5))
.build()
.expect("创建 HTTP 客户端失败");
// 启动时清理:过期订单 + 过期登录码 // 启动时清理:过期订单 + 过期登录码
match db::cleanup_expired_pending_orders(&pool, None).await { match db::cleanup_expired_pending_orders(&pool, None).await {