Remove idle connection timeout handling
Remove error handling for closed connections Add progress watchdog to detect stalled accounts Improve error modal styling and pagination
This commit is contained in:
@@ -3,8 +3,11 @@ package imapx
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/emersion/go-imap/v2"
|
||||
@@ -180,6 +183,12 @@ func CopyFolder(ctx context.Context, src, dst *imapclient.Client, srcFolder, dst
|
||||
if err := streamOne(src, dst, dstFolder, q.uid, q.flags, q.internalDate); err != nil {
|
||||
res.Errors++
|
||||
reportErr(msgRef(q.uid, q.subject), "copy message: "+err.Error())
|
||||
// A closed/broken connection won't recover: every remaining APPEND
|
||||
// would fail identically. Abort the folder instead of logging
|
||||
// thousands of the same error; a re-run resumes via dedup.
|
||||
if errors.Is(err, net.ErrClosed) || strings.Contains(err.Error(), "use of closed network connection") {
|
||||
return res, fmt.Errorf("dst connection lost in %q: %w", dstFolder, err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if err := deps.MarkMigrated(dstFolder, q.key); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user