diff --git a/pkg/infra/serverlock/serverlock.go b/pkg/infra/serverlock/serverlock.go index e662f85af4f..95b2027a81f 100644 --- a/pkg/infra/serverlock/serverlock.go +++ b/pkg/infra/serverlock/serverlock.go @@ -39,7 +39,7 @@ func (sl *ServerLockService) LockAndExecute(ctx context.Context, actionName stri // avoid execution if last lock happened less than `maxInterval` ago if rowLock.LastExecution != 0 { lastExecutionTime := time.Unix(rowLock.LastExecution, 0) - if lastExecutionTime.Unix() > time.Now().Add(-maxInterval).Unix() { + if time.Since(lastExecutionTime) < maxInterval { return nil } }