Add crawler delay config + dynamic config values (#11018)

This commit is contained in:
Klaus Post
2020-12-04 09:32:35 -08:00
committed by GitHub
parent e083471ec4
commit a896125490
19 changed files with 440 additions and 89 deletions

9
pkg/env/env.go vendored
View File

@@ -24,10 +24,19 @@ import (
var (
privateMutex sync.RWMutex
lockEnvMutex sync.Mutex
envOff bool
)
// LockSetEnv locks modifications to environment.
// Call returned function to unlock.
func LockSetEnv() func() {
lockEnvMutex.Lock()
return lockEnvMutex.Unlock
}
// SetEnvOff - turns off env lookup
// A global lock above this MUST ensure that
func SetEnvOff() {
privateMutex.Lock()
defer privateMutex.Unlock()