Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
clear cancel func after cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
willscott committed Mar 17, 2020
1 parent 990c842 commit 02b3ad4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autonat.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ func (as *AmbientAutoNAT) recordObservation(observation autoNATResult) {
as.status.Store(observation)
if as.serviceCancel != nil {
as.serviceCancel()
as.serviceCancel = nil
}
as.emitStatus()
}
Expand All @@ -276,6 +277,7 @@ func (as *AmbientAutoNAT) recordObservation(observation autoNATResult) {
if currentStatus.Reachability != network.ReachabilityUnknown {
if as.serviceCancel != nil {
as.serviceCancel()
as.serviceCancel = nil
}
as.emitStatus()
}
Expand Down

0 comments on commit 02b3ad4

Please sign in to comment.