From 9b33140cc8debb753576fa261ec373c75f167200 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Mon, 15 May 2023 17:42:31 +0000 Subject: [PATCH] feat: always set last fetch date --- distro/debian/kernel.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/distro/debian/kernel.go b/distro/debian/kernel.go index 9b0207a..f4ef5b9 100644 --- a/distro/debian/kernel.go +++ b/distro/debian/kernel.go @@ -298,13 +298,11 @@ func GetKernels() (kernels []DebianKernel, err error) { } dk.Internal.Invalid = true - dk.Internal.LastFetch = time.Now() } if !dk.HasDependency("kbuild") { if !kver(dk.Version.Package).LessThan(kver("4.5-rc0")) { dk.Internal.Invalid = true - dk.Internal.LastFetch = time.Now() } else { // Debian kernels prior to the 4.5 package // version did not have a kbuild built from @@ -316,7 +314,6 @@ func GetKernels() (kernels []DebianKernel, err error) { ) if err != nil { dk.Internal.Invalid = true - dk.Internal.LastFetch = time.Now() } else { dk.Dependencies = append( dk.Dependencies, @@ -326,6 +323,8 @@ func GetKernels() (kernels []DebianKernel, err error) { } } + dk.Internal.LastFetch = time.Now() + err = c.Put(dk) if err != nil { slog.Error().Err(err).Msg("put to cache")