diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab35c1a..8946e4a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/ ## [Unreleased] +### Fixed + +- 延长 registry_update 触发等待时间到 5 分钟 + ## [3.2.2] - 2024-01-30 ### Fixed diff --git a/src/plugins/publish/utils.py b/src/plugins/publish/utils.py index e09dec3a..5020a7a5 100644 --- a/src/plugins/publish/utils.py +++ b/src/plugins/publish/utils.py @@ -556,8 +556,8 @@ async def trigger_registry_update( owner, repo = plugin_config.input_config.registry_repository.split("/") # GitHub 的缓存一般 2 分钟左右会刷新 - logger.info("准备触发商店列表更新,等待 2 分钟") - await asyncio.sleep(120) + logger.info("准备触发商店列表更新,等待 5 分钟") + await asyncio.sleep(300) # 触发商店列表更新 await bot.rest.repos.async_create_dispatch_event( repo=repo, diff --git a/tests/publish/process/test_pull_request.py b/tests/publish/process/test_pull_request.py index f11f7afa..783ab2fd 100644 --- a/tests/publish/process/test_pull_request.py +++ b/tests/publish/process/test_pull_request.py @@ -122,7 +122,7 @@ async def test_process_pull_request(app: App, mocker: MockerFixture) -> None: # NOTE: 不知道为什么会调用两次 # 那个 0 不知道哪里来的。 # 在 GitHub Actions 上又只有一个了,看来是本地的环境问题。 - mock_sleep.assert_awaited_once_with(120) + mock_sleep.assert_awaited_once_with(300) async def test_process_pull_request_not_merged(app: App, mocker: MockerFixture) -> None: @@ -311,7 +311,7 @@ async def test_process_pull_request_skip_plugin_test( any_order=True, ) - mock_sleep.assert_awaited_once_with(120) + mock_sleep.assert_awaited_once_with(300) async def test_not_publish(app: App, mocker: MockerFixture) -> None: diff --git a/tests/publish/utils/test_trigger_registry_update.py b/tests/publish/utils/test_trigger_registry_update.py index 2b94e016..7df5499c 100644 --- a/tests/publish/utils/test_trigger_registry_update.py +++ b/tests/publish/utils/test_trigger_registry_update.py @@ -68,7 +68,7 @@ async def test_trigger_registry_update(app: App, mocker: MockerFixture): mock_issue, ) - mock_sleep.assert_awaited_once_with(120) + mock_sleep.assert_awaited_once_with(300) async def test_trigger_registry_update_skip_test( @@ -132,7 +132,7 @@ async def test_trigger_registry_update_skip_test( mock_issue, ) - mock_sleep.assert_awaited_once_with(120) + mock_sleep.assert_awaited_once_with(300) async def test_trigger_registry_update_bot(app: App, mocker: MockerFixture): @@ -176,7 +176,7 @@ async def test_trigger_registry_update_bot(app: App, mocker: MockerFixture): mock_issue, ) - mock_sleep.assert_awaited_once_with(120) + mock_sleep.assert_awaited_once_with(300) async def test_trigger_registry_update_plugins_issue_body_info_missing(