aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/fetch.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap/fetch.go')
-rw-r--r--worker/imap/fetch.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go
index 74108135..0c923bf0 100644
--- a/worker/imap/fetch.go
+++ b/worker/imap/fetch.go
@@ -19,6 +19,12 @@ import (
func (imapw *IMAPWorker) handleFetchMessageHeaders(
msg *types.FetchMessageHeaders,
) {
+ if msg.Context.Err() != nil {
+ imapw.worker.PostMessage(&types.Cancelled{
+ Message: types.RespondTo(msg),
+ }, nil)
+ return
+ }
toFetch := msg.Uids
if imapw.config.cacheEnabled && imapw.cache != nil {
toFetch = imapw.getCachedHeaders(msg)
@@ -210,6 +216,12 @@ func (imapw *IMAPWorker) handleFetchMessageFlags(msg *types.FetchMessageFlags) {
imap.FetchFlags,
imap.FetchUid,
}
+ if msg.Context.Err() != nil {
+ imapw.worker.PostMessage(&types.Cancelled{
+ Message: types.RespondTo(msg),
+ }, nil)
+ return
+ }
imapw.handleFetchMessages(msg, msg.Uids, items,
func(_msg *imap.Message) error {
imapw.worker.PostMessage(&types.MessageInfo{