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

update: expand the retry method to support timeout and interval control #3283

Merged
merged 1 commit into from
May 28, 2023

Conversation

jiang4869
Copy link
Contributor

@jiang4869 jiang4869 commented May 25, 2023

In order to prevent repeated execution of certain methods, the DoWithTry method has been extended to support timeout and interval control due to the assumption that the situation is blocking, resulting in unrestricted waiting and too frequent retries

Adding context parameters can determine whether the program terminates before executing critical operations

The newly added part has been tested and does not affect the original functionality. It also meets expectations for timeout and interval control.

To avoid accidental situations, these three testing methods were executed dozens of times
image
image

note: The possible impact of this change is that if a variable other than fn is called in the first parameter fn of the original DowithRetry method and is modified, a race error may occur

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #3283 (59e7d2f) into master (32f7866) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
core/fx/retry.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

core/fx/retry.go Outdated Show resolved Hide resolved
core/fx/retry.go Outdated Show resolved Hide resolved
core/fx/retry.go Outdated Show resolved Hide resolved
@kevwan kevwan merged commit 8d48e34 into zeromicro:master May 28, 2023
6 of 7 checks passed
wuyazi pushed a commit to wuyazi/go-zero that referenced this pull request Jun 14, 2023
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.

None yet

2 participants