aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap')
-rw-r--r--worker/imap/cache.go3
-rw-r--r--worker/imap/flags.go6
2 files changed, 6 insertions, 3 deletions
diff --git a/worker/imap/cache.go b/worker/imap/cache.go
index 62d450e6..3c807c50 100644
--- a/worker/imap/cache.go
+++ b/worker/imap/cache.go
@@ -126,7 +126,8 @@ func (w *IMAPWorker) getCachedHeaders(msg *types.FetchMessageHeaders) []uint32 {
}, nil)
}
if len(found) > 0 {
- w.worker.PostAction(&types.FetchMessageFlags{
+ // Post in a separate goroutine to prevent deadlocking
+ go w.worker.PostAction(&types.FetchMessageFlags{
Uids: found,
}, nil)
}
diff --git a/worker/imap/flags.go b/worker/imap/flags.go
index bda47e9d..0cd0bb78 100644
--- a/worker/imap/flags.go
+++ b/worker/imap/flags.go
@@ -48,7 +48,8 @@ func (imapw *IMAPWorker) handleAnsweredMessages(msg *types.AnsweredMessages) {
emitErr(err)
return
}
- imapw.worker.PostAction(&types.FetchMessageHeaders{
+ // Post in a separate goroutine to prevent deadlocking
+ go imapw.worker.PostAction(&types.FetchMessageHeaders{
Uids: msg.Uids,
}, func(_msg types.WorkerMessage) {
switch m := _msg.(type) {
@@ -79,7 +80,8 @@ func (imapw *IMAPWorker) handleFlagMessages(msg *types.FlagMessages) {
emitErr(err)
return
}
- imapw.worker.PostAction(&types.FetchMessageHeaders{
+ // Post in a separate goroutine to prevent deadlocking
+ go imapw.worker.PostAction(&types.FetchMessageHeaders{
Uids: msg.Uids,
}, func(_msg types.WorkerMessage) {
switch m := _msg.(type) {