From d9a80e07b993c487ef6aa868ecbfc21a67cae243 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 6 Mar 2020 23:37:51 +0100 Subject: [PATCH] repository: Simplify index age calculation --- internal/repository/index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/repository/index.go b/internal/repository/index.go index 216d1afc1..ce0d1da82 100644 --- a/internal/repository/index.go +++ b/internal/repository/index.go @@ -107,7 +107,7 @@ var IndexFull = func(idx *Index) bool { for typ := range idx.byType { blobs += idx.byType[typ].len() } - age := time.Now().Sub(idx.created) + age := time.Since(idx.created) switch { case age >= indexMaxAge: