From 615e3d4840c96153db48fbc9d0f3b195cbf60af3 Mon Sep 17 00:00:00 2001 From: Michal Schott Date: Tue, 5 May 2020 13:57:11 +0200 Subject: [PATCH] Calculate time difference easier. --- pkg/daemonsetlock/daemonsetlock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/daemonsetlock/daemonsetlock.go b/pkg/daemonsetlock/daemonsetlock.go index 47da093..84de9df 100644 --- a/pkg/daemonsetlock/daemonsetlock.go +++ b/pkg/daemonsetlock/daemonsetlock.go @@ -134,7 +134,7 @@ func (dsl *DaemonSetLock) Release() error { } func ttlExpired(created time.Time, ttl time.Duration) bool { - if ttl > 0 && time.Now().UTC().Sub(created) >= ttl { + if ttl > 0 && time.Since(created) >= ttl { return true } return false