1
0
Fork 0

Add documentation about checkNewVersion

This commit is contained in:
Rémi BUISSON 2025-11-21 16:09:54 +01:00 committed by GitHub
parent 4ed8f08757
commit 155b29edbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 87 additions and 33 deletions

View file

@ -114,9 +114,7 @@ func runCmd(staticConfiguration *static.Configuration) error {
log.Debug().RawJSON("staticConfiguration", []byte(redactedStaticConfiguration)).Msg("Static configuration loaded [json]")
}
if staticConfiguration.Global.CheckNewVersion {
checkNewVersion()
}
checkNewVersion(staticConfiguration)
stats(staticConfiguration)
@ -614,13 +612,28 @@ func setupTracing(ctx context.Context, conf *static.Tracing) (*tracing.Tracer, i
return tracer, closer
}
func checkNewVersion() {
ticker := time.Tick(24 * time.Hour)
safe.Go(func() {
for time.Sleep(10 * time.Minute); ; <-ticker {
version.CheckNewVersion()
}
})
func checkNewVersion(staticConfiguration *static.Configuration) {
logger := log.With().Logger()
if staticConfiguration.Global.CheckNewVersion {
logger.Info().Msg(`Version check is enabled.`)
logger.Info().Msg(`Traefik checks for new releases to notify you if your version is out of date.`)
logger.Info().Msg(`It also collects usage data during this process.`)
logger.Info().Msg(`Check the documentation to get more info: https://doc.traefik.io/traefik/contributing/data-collection/`)
ticker := time.Tick(24 * time.Hour)
safe.Go(func() {
for time.Sleep(10 * time.Minute); ; <-ticker {
version.CheckNewVersion()
}
})
} else {
logger.Info().Msg(`
Version check is disabled.
You will not be notified if a new version is available.
More details: https://doc.traefik.io/traefik/contributing/data-collection/
`)
}
}
func stats(staticConfiguration *static.Configuration) {