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

add retry.Do0 #12194

Merged
merged 2 commits into from
Sep 29, 2024
Merged

add retry.Do0 #12194

merged 2 commits into from
Sep 29, 2024

Conversation

zhiqiangxu
Copy link
Contributor

@zhiqiangxu zhiqiangxu commented Sep 28, 2024

The Do and Do2 expects a function that returns (T,error) and (T,U,error) respectively.

This PR adds a Do0 function that accepts a function that returns error only, which is handy in many cases.

@zhiqiangxu zhiqiangxu requested a review from a team as a code owner September 28, 2024 08:06
@zhiqiangxu zhiqiangxu requested a review from ajsutton September 28, 2024 08:06
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.97%. Comparing base (c7ab63b) to head (48700ea).
Report is 17 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12194      +/-   ##
===========================================
- Coverage    75.19%   74.97%   -0.22%     
===========================================
  Files           49       49              
  Lines         3656     3656              
===========================================
- Hits          2749     2741       -8     
- Misses         734      743       +9     
+ Partials       173      172       -1     
Flag Coverage Δ
cannon-go-tests 74.97% <ø> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

@ajsutton
Copy link
Contributor

I like the idea, but nothing is actually using it. Are the places in the code that should be updated to use the new Do0 function?

@zhiqiangxu zhiqiangxu requested a review from a team as a code owner September 29, 2024 23:40
@zhiqiangxu zhiqiangxu requested a review from geoknee September 29, 2024 23:40
@zhiqiangxu
Copy link
Contributor Author

I like the idea, but nothing is actually using it. Are the places in the code that should be updated to use the new Do0 function?

It was my code outside that wanted to reuse retry package in the monorepo, but I also find two places in the monorepo that can be refactored to use the Do0.

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ajsutton ajsutton enabled auto-merge September 29, 2024 23:46
@ajsutton ajsutton added this pull request to the merge queue Sep 29, 2024
Merged via the queue into ethereum-optimism:develop with commit f2d5e32 Sep 29, 2024
63 checks passed
samlaf pushed a commit to samlaf/optimism that referenced this pull request Nov 10, 2024
* add retry.Do0

* update code to use Do0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants