feat: use breaker with ctx to prevent deadline exceeded (#4091)

Signed-off-by: kevin <wanjunfeng@gmail.com>
This commit is contained in:
Kevin Wan
2024-04-18 23:18:49 +08:00
committed by GitHub
parent 1b9b61f505
commit d371ab5479
8 changed files with 47 additions and 53 deletions

View File

@@ -63,7 +63,7 @@ func (s namedService) do(r *http.Request) (resp *http.Response, err error) {
}
brk := breaker.GetBreaker(s.name)
err = brk.DoWithAcceptable(func() error {
err = brk.DoWithAcceptableCtx(r.Context(), func() error {
resp, err = s.cli.Do(r)
return err
}, func(err error) bool {