Fix worker thread blocking startup by deferring IMAP connection

The eager connect() call in the worker thread could hang if the server
was unreachable, preventing the worker from ever processing commands.
Let refresh() handle the initial connection instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Shautvast 2026-02-18 08:57:57 +01:00
parent 212fd49534
commit 7269eca3e9

View file

@ -50,7 +50,7 @@ fn worker_loop(
cmd_rx: mpsc::Receiver<WorkerCmd>,
result_tx: mpsc::Sender<WorkerResult>,
) {
let mut session = connect::connect(&config).ok();
let mut session: Option<connect::ImapSession> = None;
for cmd in &cmd_rx {
match cmd {