Skip to content

Commit

Permalink
fix: 延长 registry_update 触发等待时间到 5 分钟 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Feb 1, 2024
1 parent 378dd69 commit 7180040
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
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

0 comments on commit 7180040

Please sign in to comment.