From dbcb1fa78b26fdaffc339de82efd486b9786489a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=80=E1=B4=8D=E1=B4=9B=E1=B4=8F=E1=B4=80=E1=B4=87?= =?UTF-8?q?=CA=80?= Date: Wed, 6 Aug 2025 10:37:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BA=E5=A1=AB=E5=85=85=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E8=AF=A6=E6=83=85=E6=B7=BB=E5=8A=A0=E5=B9=B6=E5=8F=91?= =?UTF-8?q?=E9=99=90=E5=88=B6=EF=BC=8C=E9=81=BF=E5=85=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=AB=9E=E4=BA=89=20(#419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/bili_sync/src/workflow.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/bili_sync/src/workflow.rs b/crates/bili_sync/src/workflow.rs index 6fe87ef..4fc34e7 100644 --- a/crates/bili_sync/src/workflow.rs +++ b/crates/bili_sync/src/workflow.rs @@ -102,10 +102,13 @@ pub async fn fetch_video_details( ) -> Result<()> { video_source.log_fetch_video_start(); let videos_model = filter_unfilled_videos(video_source.filter_expr(), connection).await?; + let semaphore = Semaphore::new(VersionedConfig::get().load().concurrent_limit.video); + let semaphore_ref = &semaphore; let tasks = videos_model .into_iter() .map(|video_model| { async move { + let _permit = semaphore_ref.acquire().await.context("acquire semaphore failed")?; let video = Video::new(bili_client, video_model.bvid.clone()); let info: Result<_> = async { Ok((video.get_tags().await?, video.get_view_info().await?)) }.await; match info {