diff options
| author | Rich Brown <[email protected]> | 2022-05-05 06:32:23 -0400 |
|---|---|---|
| committer | Rich Brown <[email protected]> | 2022-05-05 06:32:23 -0400 |
| commit | 79c333fd9811f01eb7277faeeae10fb026ccc84a (patch) | |
| tree | 3f17058344c5e40d29c81a617b4d99ae28070d6c /timeoutat/timeoutat.go | |
| parent | 67c44be2794a3d49a372c73b859c8063888f3fac (diff) | |
| parent | 2a9feb82b55481308c0f6aa9d813e9021b0333ef (diff) | |
Merge branch 'main' of https://github.com/richb-hanover/goresponsiveness-1
* 'main' of https://github.com/richb-hanover/goresponsiveness-1:
Upgraded RPM Calculation Support (Take 1)
Make Traceable Interface and Refactor Debugging
Fully support self-signed certificates (and add debug levels)
Diffstat (limited to 'timeoutat/timeoutat.go')
| -rw-r--r-- | timeoutat/timeoutat.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/timeoutat/timeoutat.go b/timeoutat/timeoutat.go index 0e13a9f..673ca38 100644 --- a/timeoutat/timeoutat.go +++ b/timeoutat/timeoutat.go @@ -18,17 +18,19 @@ import ( "context" "fmt" "time" + + "github.com/network-quality/goresponsiveness/debug" ) func TimeoutAt( ctx context.Context, when time.Time, - debug bool, + debugLevel debug.DebugLevel, ) (response chan interface{}) { response = make(chan interface{}) go func(ctx context.Context) { go func() { - if debug { + if debug.IsDebug(debugLevel) { fmt.Printf("Timeout expected to end at %v\n", when) } select { @@ -36,7 +38,7 @@ func TimeoutAt( case <-ctx.Done(): } response <- struct{}{} - if debug { + if debug.IsDebug(debugLevel) { fmt.Printf("Timeout ended at %v\n", time.Now()) } }() |
