mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 09:48:49 +02:00
refactor: remove / throttle some debug logging
This commit is contained in:
@@ -2,7 +2,6 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/puzpuzpuz/xsync/v4"
|
"github.com/puzpuzpuz/xsync/v4"
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var idDockerHostMap = xsync.NewMap[string, string](xsync.WithPresize(100))
|
var idDockerHostMap = xsync.NewMap[string, string](xsync.WithPresize(100))
|
||||||
@@ -12,7 +11,6 @@ func GetDockerHostByContainerID(id string) (string, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SetDockerHostByContainerID(id, host string) {
|
func SetDockerHostByContainerID(id, host string) {
|
||||||
log.Debug().Str("id", id).Str("host", host).Int("size", idDockerHostMap.Size()).Msg("setting docker host by container id")
|
|
||||||
idDockerHostMap.Store(id, host)
|
idDockerHostMap.Store(id, host)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,10 +151,14 @@ func (w *Watcher) checkUpdateState() (ready bool, err error) {
|
|||||||
healthTries: newHealthTries,
|
healthTries: newHealthTries,
|
||||||
})
|
})
|
||||||
|
|
||||||
w.l.Debug().
|
// log every 3 seconds
|
||||||
Int("health_tries", newHealthTries).
|
const everyN = int(3 * time.Second / idleWakerCheckInterval)
|
||||||
Dur("elapsed", time.Since(state.startedAt)).
|
if newHealthTries%everyN == 0 {
|
||||||
Msg("health check failed, still starting")
|
w.l.Debug().
|
||||||
|
Int("health_tries", newHealthTries).
|
||||||
|
Dur("elapsed", time.Since(state.startedAt)).
|
||||||
|
Msg("health check failed, still starting")
|
||||||
|
}
|
||||||
|
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user