aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/cache.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--internal/feed/cache.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/feed/cache.go b/internal/feed/cache.go
index fa22139..bf64c4a 100644
--- a/internal/feed/cache.go
+++ b/internal/feed/cache.go
@@ -104,8 +104,12 @@ func storeCache(cache Cache, fileName string) error {
writer.Flush()
log.Printf("Stored cache to '%s'.", fileName)
+ return UnlockCache(cache)
+}
+
+func UnlockCache(cache Cache) error {
if cache.locked {
- if err = cache.lock.Unlock(); err != nil {
+ if err := cache.lock.Unlock(); err != nil {
return fmt.Errorf("Unlocking cache: %w", err)
}
}