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: interrupt as soon as we retry #31

Merged
merged 1 commit into from
Aug 7, 2020
Merged

Conversation

eps1lon
Copy link
Owner

@eps1lon eps1lon commented Aug 7, 2020

Assume we start the run with two PRs in an unknown state.

  1. first PR is unknown schedule retry
  2. first PR is mergable
  3. second PR is mergable
  4. wait 2 minutes
  5. second PR is unknown => schedule retry
  6. first PR is mergable
  7. second PR is mergable

As soon as we schedule a retry we can interrupt the loop. It is redundant. Even worse: Every retry queries all PRs which leads to exponential growth in retries.

Since it's very likely that subsequent PRs are also in an unknown state we can stop looping. We'll revisit them in the retry anyway.

Also makes checkDirty side-effect free. main is now responsible for setting the output which ensures we're not setting it multiple times.

@eps1lon eps1lon added the bug Something isn't working label Aug 7, 2020
@eps1lon eps1lon merged commit e04ca20 into main Aug 7, 2020
@eps1lon eps1lon deleted the fix/retry-immediate-abort branch August 7, 2020 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant