mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Update many modules (#620)
* Update many modules. go get -u golang.org/x/net go get -u github.com/aws/aws-sdk-go go get -u golang.org/x/oauth2 go get -u google.golang.org/api go get -u gopkg.in/yaml.v2 go mod tidy * Update modules go get -u github.com/tiramiseb/go-gandi go get -u github.com/miekg/dns go mod tidy
This commit is contained in:
10
vendor/github.com/miekg/dns/singleinflight.go
generated
vendored
10
vendor/github.com/miekg/dns/singleinflight.go
generated
vendored
@ -23,6 +23,8 @@ type call struct {
|
||||
type singleflight struct {
|
||||
sync.Mutex // protects m
|
||||
m map[string]*call // lazily initialized
|
||||
|
||||
dontDeleteForTesting bool // this is only to be used by TestConcurrentExchanges
|
||||
}
|
||||
|
||||
// Do executes and returns the results of the given function, making
|
||||
@ -49,9 +51,11 @@ func (g *singleflight) Do(key string, fn func() (*Msg, time.Duration, error)) (v
|
||||
c.val, c.rtt, c.err = fn()
|
||||
c.wg.Done()
|
||||
|
||||
g.Lock()
|
||||
delete(g.m, key)
|
||||
g.Unlock()
|
||||
if !g.dontDeleteForTesting {
|
||||
g.Lock()
|
||||
delete(g.m, key)
|
||||
g.Unlock()
|
||||
}
|
||||
|
||||
return c.val, c.rtt, c.err, c.dups > 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user