aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/worker.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-04-30 01:08:57 +0200
committerRobin Jarry <robin@jarry.cc>2022-05-04 14:07:15 +0200
commitb92efe4cd944c97bf8310ca47d4edbef968cfaae (patch)
treeae9a99efa86fea6087673612f969226d49a9e9da /worker/imap/worker.go
parente5b339702a56fa02dedec770a79b64313fb30108 (diff)
downloadaerc-b92efe4cd944c97bf8310ca47d4edbef968cfaae.tar.gz
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 <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/imap/worker.go')
-rw-r--r--worker/imap/worker.go1
1 files changed, 1 insertions, 0 deletions
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