1
0

feat: always set last fetch date

This commit is contained in:
dump_stack() 2023-05-15 17:42:31 +00:00
parent c13b595ab1
commit 9b33140cc8
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -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")