This commit is contained in:
2026-07-18 12:21:58 +07:00
parent b352cda166
commit d125320667
3 changed files with 145 additions and 0 deletions
+9
View File
@@ -354,6 +354,15 @@ func (o *Orchestrator) runAccount(ctx context.Context, task store.Task, runID in
_ = dst.Close()
}()
// Keep the destination connection warm. It sits idle for the whole
// source-side metadata scan (Pass 1 of CopyFolder), which on a large
// mailbox runs for minutes; without traffic the server drops it and every
// subsequent APPEND fails with "use of closed network connection", copying
// nothing. Periodic NOOPs prevent that. Only dst needs it — src is
// continuously busy scanning/fetching. Bound to actx so it stops with the
// account.
go imapx.Keepalive(actx, dst, imapx.KeepaliveInterval)
// Progress watchdog: track the last time we saw scan/copy activity; if it
// goes quiet for stallTimeout, cancel the account so the connections close
// and this worker unwinds (it would otherwise block forever on a silent