Add body read timeout recovery to IMAP client

Introduce Client wrapper with socket deadline support
Add reconnection logic for body read timeouts
Implement test cases for underflow scenarios
Update orchestrator to handle reconnections
This commit is contained in:
2026-07-21 05:29:35 +07:00
parent c741cd19a0
commit 6bf3a6c4ca
6 changed files with 375 additions and 30 deletions
+1 -3
View File
@@ -3,8 +3,6 @@ package imapx
import (
"context"
"time"
"github.com/emersion/go-imap/v2/imapclient"
)
// KeepaliveInterval is how often an otherwise-idle IMAP connection is pinged
@@ -31,7 +29,7 @@ const KeepaliveInterval = 60 * time.Second
//
// Keepalive returns when ctx is done or when a NOOP fails — a failed NOOP means
// the connection is already gone, so there is nothing left to keep alive.
func Keepalive(ctx context.Context, c *imapclient.Client, interval time.Duration) {
func Keepalive(ctx context.Context, c *Client, interval time.Duration) {
t := time.NewTicker(interval)
defer t.Stop()
for {