Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 延长 registry_update 触发等待时间到 5 分钟 #199

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/publish/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/publish/process/test_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions tests/publish/utils/test_trigger_registry_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down
Loading