mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-07 11:28:48 +03:00
git: Fixed unusual but potent race condition
This commit is contained in:
parent
346135fed3
commit
6f05794bb8
2 changed files with 4 additions and 3 deletions
|
@ -82,7 +82,7 @@ func TLS(c *Controller) (middleware.Middleware, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map of supported protocols
|
// Map of supported protocols
|
||||||
// SSLv3 will be not supported in next release
|
// SSLv3 will be not supported in future release
|
||||||
// HTTP/2 only supports TLS 1.2 and higher
|
// HTTP/2 only supports TLS 1.2 and higher
|
||||||
var supportedProtocols = map[string]uint16{
|
var supportedProtocols = map[string]uint16{
|
||||||
"ssl3.0": tls.VersionSSL30,
|
"ssl3.0": tls.VersionSSL30,
|
||||||
|
|
|
@ -62,8 +62,9 @@ type Repo struct {
|
||||||
func (r *Repo) Pull() error {
|
func (r *Repo) Pull() error {
|
||||||
r.Lock()
|
r.Lock()
|
||||||
defer r.Unlock()
|
defer r.Unlock()
|
||||||
// if it is less than interval since last pull, return
|
|
||||||
if time.Since(r.lastPull) <= r.Interval {
|
// prevent a pull if the last one was less than 5 seconds ago
|
||||||
|
if time.Since(r.lastPull) < 5*time.Second {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue