Reduce worker concurrency from 4 to 2

Reduce idle read timeout from 120s to 60s

Add batching for IMAP metadata fetches
This commit is contained in:
2026-07-05 11:40:04 +07:00
parent b9cc7749c8
commit 2623bc8815
6 changed files with 125 additions and 36 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ func Load() (Config, error) {
AuthUser: os.Getenv("AUTH_USER"),
AuthPass: os.Getenv("AUTH_PASS"),
SessionSecret: []byte(os.Getenv("SESSION_SECRET")),
WorkerConcurrency: 4,
WorkerConcurrency: 2,
PprofAddr: os.Getenv("PPROF_ADDR"),
}
if v := os.Getenv("WORKER_CONCURRENCY"); v != "" {
+2 -2
View File
@@ -31,7 +31,7 @@ func TestLoadDefaults(t *testing.T) {
if cfg.HTTPAddr != ":8080" {
t.Errorf("HTTPAddr = %q, want :8080", cfg.HTTPAddr)
}
if cfg.WorkerConcurrency != 4 {
t.Errorf("WorkerConcurrency = %d, want 4", cfg.WorkerConcurrency)
if cfg.WorkerConcurrency != 2 {
t.Errorf("WorkerConcurrency = %d, want 2", cfg.WorkerConcurrency)
}
}