mirror of https://github.com/dapr/kit.git
Revert "Tiny: use `Load` instead of `CompareAndSwap` for detecting recoveries (#69)"
This reverts commit a0df11f512.
This commit is contained in:
parent
a0df11f512
commit
8b5f336115
|
|
@ -159,7 +159,7 @@ func NotifyRecover(operation backoff.Operation, b backoff.BackOff, notify backof
|
|||
return backoff.RetryNotify(func() error {
|
||||
err := operation()
|
||||
|
||||
if err == nil && notified.Load() {
|
||||
if err == nil && notified.CompareAndSwap(true, false) {
|
||||
recovered()
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ func NotifyRecoverWithData[T any](operation backoff.OperationWithData[T], b back
|
|||
return backoff.RetryNotifyWithData(func() (T, error) {
|
||||
res, err := operation()
|
||||
|
||||
if err == nil && notified.Load() {
|
||||
if err == nil && notified.CompareAndSwap(true, false) {
|
||||
recovered()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue