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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user