mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 00:13:52 +01:00
parent
b8d9f4ba92
commit
348ecde574
@ -9,6 +9,16 @@ import (
|
|||||||
|
|
||||||
var cache sync.Map
|
var cache sync.Map
|
||||||
|
|
||||||
|
// capture the actual envconst values used at runtime
|
||||||
|
func DebugDump() map[string]interface{} {
|
||||||
|
m := make(map[string]interface{})
|
||||||
|
cache.Range(func(k, v interface{}) bool {
|
||||||
|
m[k.(string)] = v
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
func Duration(varname string, def time.Duration) time.Duration {
|
func Duration(varname string, def time.Duration) time.Duration {
|
||||||
if v, ok := cache.Load(varname); ok {
|
if v, ok := cache.Load(varname); ok {
|
||||||
return v.(time.Duration)
|
return v.(time.Duration)
|
||||||
|
Loading…
Reference in New Issue
Block a user