-
Notifications
You must be signed in to change notification settings - Fork 286
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
feat: add func invoker #744
feat: add func invoker #744
Conversation
|
||
type FuncInvoker struct { | ||
services map[string]FuncService | ||
ServicesMapLock sync.Mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the lock on its guard object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我是说把 lock 放在 map 上面,你这还是在 map 下面哦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦 我之前理解错了 已修正
Can this invoker match err to retry? |
support retry now |
@@ -191,22 +191,19 @@ func (f *FuncServiceImpl) needRetry(impl *state.ServiceTaskStateImpl, countMap m | |||
return false | |||
} | |||
|
|||
currentInterval := f.calculateRetryInterval(retry, attempt) | |||
interval := retry.IntervalSecond() | |||
backoffRate := retry.BackoffRate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 195 以下这块代码可以精简为:
backoffRate := retry.BackoffRate()
curInterval := int64(interval * 1000)
if attempt {
curInterval = int64(interval * backoffRate * float64(attempt) * 1000)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Quality Gate passedIssues Measures |
What this PR does:
This PR supports local method calls (including methods within structs).
Which issue(s) this PR fixes:
Fixes #729
Special notes for your reviewer:
Does this PR introduce a user-facing change?: