fix: load cache integrity as plain map (#60)

This commit is contained in:
mircearoata 2024-02-02 00:34:22 +01:00 committed by GitHub
parent c67285a76c
commit 5e9fe2aebb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,10 +87,15 @@ func loadHashCache() {
return return
} }
if err := json.Unmarshal(hashCacheJSON, &hashCache); err != nil { var plainCache map[string]hashInfo
if err := json.Unmarshal(hashCacheJSON, &plainCache); err != nil {
slog.Warn("failed to unmarshal hash cache, recreating", slog.Any("err", err)) slog.Warn("failed to unmarshal hash cache, recreating", slog.Any("err", err))
return return
} }
for k, v := range plainCache {
hashCache.Store(k, v)
}
} }
func saveHashCache() { func saveHashCache() {