aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/cache.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-08-22 23:12:54 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-08-22 23:12:54 +0200
commit297a88845eec93f78304b5081a19b9e561652d92 (patch)
tree238027442b028b6e1091d117311cc1e601f46cc0 /internal/feed/cache.go
parent76cbcdab3fd9cc6463f15be354b9264ccdb5aa27 (diff)
downloadfeed2imap-go-297a88845eec93f78304b5081a19b9e561652d92.tar.gz
feed2imap-go-297a88845eec93f78304b5081a19b9e561652d92.tar.bz2
feed2imap-go-297a88845eec93f78304b5081a19b9e561652d92.zip
print-cache should also unlock
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)
}
}