Skip to content

Commit

Permalink
Merge pull request #197 from Mark-Simulacrum/sleep-before-fetch
Browse files Browse the repository at this point in the history
Add delay before querying base ref
  • Loading branch information
Mark-Simulacrum committed Sep 23, 2023
2 parents ce600b9 + 75980ad commit 79d8b30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions homu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,11 @@ def branch_equal_to_merge(git_cmd, state, branch):

def create_merge(state, repo_cfg, branch, logger, git_cfg,
ensure_merge_equal=False):
# Add some delay to try to make sure the base repo fetch is accurate.
# It seems like in some cases we're getting the previous commit from GH,
# e.g., https://github.com/rust-lang/homu/issues/75#issuecomment-1729058969
# Hopefully a delay helps.
time.sleep(60)
base_sha = state.get_repo().ref('heads/' + state.base_ref).object.sha

state.refresh()
Expand Down

0 comments on commit 79d8b30

Please sign in to comment.