aboutsummaryrefslogtreecommitdiff
path: root/internal/imap/mailboxes.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 16:43:39 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 17:43:31 +0100
commit1f03f19402266c63bbb7120f50caacf3f6f79a36 (patch)
treedbdfb686393d7d9a924afca77433c507bf311e83 /internal/imap/mailboxes.go
parent3e9a26af773f5025e1540f9be5da952c448f1edd (diff)
downloadfeed2imap-go-1f03f19402266c63bbb7120f50caacf3f6f79a36.tar.gz
feed2imap-go-1f03f19402266c63bbb7120f50caacf3f6f79a36.tar.bz2
feed2imap-go-1f03f19402266c63bbb7120f50caacf3f6f79a36.zip
#25 Check for folder again while locking
Diffstat (limited to 'internal/imap/mailboxes.go')
-rw-r--r--internal/imap/mailboxes.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/imap/mailboxes.go b/internal/imap/mailboxes.go
index f1dc6c6..25bf087 100644
--- a/internal/imap/mailboxes.go
+++ b/internal/imap/mailboxes.go
@@ -26,6 +26,14 @@ func (mbs *mailboxes) unlocking(elem Folder) {
func (mbs *mailboxes) locking(elem Folder) bool {
mbs.mu.Lock()
+
+ // check again, if the folder has been created in the meantime
+ _, ok := mbs.mb[elem.str]
+ if ok {
+ mbs.mu.Unlock()
+ return true
+ }
+
ch, ok := mbs.changeLocks[elem.str]
if !ok {
ch = make(chan struct{})
'>GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1