This commit is contained in:
@@ -100,6 +100,7 @@ func (c *DiscogsCache) loadRecordsFromFS(ctx context.Context) ([]media.Record, t
|
||||
if err != nil {
|
||||
return nil, time.Time{}, fmt.Errorf("error opening cache file %s: %w", c.persistFile, err)
|
||||
}
|
||||
defer f.Close()
|
||||
err = gob.NewDecoder(f).Decode(p)
|
||||
if err != nil {
|
||||
return nil, time.Time{}, fmt.Errorf("error readhing from cache file %s: %w", c.persistFile, err)
|
||||
@@ -120,6 +121,7 @@ func (c *DiscogsCache) saveRecordsToCache(ctx context.Context, records []media.R
|
||||
if err != nil {
|
||||
return fmt.Errorf("error opening cache file %s: %w", c.persistFile, err)
|
||||
}
|
||||
defer f.Close()
|
||||
err = gob.NewEncoder(f).Encode(p)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error writing to cache file %s: %w", c.persistFile, err)
|
||||
|
||||
Reference in New Issue
Block a user