-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[WIP] maintnotifications e2e and refactor #3526
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
base: master
Are you sure you want to change the base?
Conversation
5c5d4dc
to
988f712
Compare
// Atomically decrement counter and check if we should clear | ||
newCount := cn.relaxedCounter.Add(-1) | ||
if newCount <= 0 { | ||
deadlineNs := cn.relaxedDeadlineNs.Load() |
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.
Minor nitpick, could we rename it to epochDeadlineNs
?
Currently, it is a bit confusing, and my initial assumption was that it's a relative value
newCount := cn.relaxedCounter.Add(-1) | ||
if newCount <= 0 { | ||
deadlineNs := cn.relaxedDeadlineNs.Load() | ||
if newCount <= 0 && (deadlineNs == 0 || time.Now().UnixNano() >= deadlineNs) { |
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.
Isn't the deadlineNs == 0
a bit redundant?
return | ||
case <-ctx.Done(): | ||
return | ||
default: |
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.
Is this leftover?
No description provided.