From b92efe4cd944c97bf8310ca47d4edbef968cfaae Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Sat, 30 Apr 2022 01:08:57 +0200 Subject: imap: add debouncer to the idler Add a debouncer to the idle mode. Avoid unnecessary idling when another job arrives within a certain time frame. For example, the ui sends three messages to the worker at the same time when we open a message (FlagMessage, FetchMessageBodyPart, and the FetchMessageHeaders). The debouncer prevents the unnecessary entering and leaving of the idle mode between those messages. Signed-off-by: Koni Marti Acked-by: Robin Jarry --- worker/imap/worker.go | 1 + 1 file changed, 1 insertion(+) (limited to 'worker/imap/worker.go') diff --git a/worker/imap/worker.go b/worker/imap/worker.go index 6e475305..1ff6341f 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -43,6 +43,7 @@ type imapConfig struct { folders []string oauthBearer lib.OAuthBearer idle_timeout time.Duration + idle_debounce time.Duration reconnect_maxwait time.Duration // tcp connection parameters connection_timeout time.Duration -- cgit