1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

fix: controller duration computation (#6569)

This commit is contained in:
Charles-Edouard Brétéché 2023-03-15 08:11:00 +01:00 committed by GitHub
parent 1271784918
commit bedc6cbd27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,6 +150,8 @@ func reconcile(ctx context.Context, logger logr.Logger, obj interface{}, r recon
}
logger = logger.WithValues("key", k, "namespace", ns, "name", n)
logger.Info("reconciling ...")
defer logger.Info("done", "duration", time.Since(start).String())
defer func(start time.Time) {
logger.Info("done", "duration", time.Since(start).String())
}(start)
return r(ctx, logger, k, ns, n)
}