Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/nzbtouch/nzb-touch.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ validate NZB files without storing the downloaded content.`,
slog.Error("Error creating connection pool", "error", err)
os.Exit(4)
}
defer pool.Quit()
// Explicitly call Quit after processing to ensure pool shutdown completes

// Create processor with configured download workers
proc := processor.New(pool, nzbData.TotalSegments, cfg.DownloadWorkers)
Expand All @@ -85,8 +85,13 @@ validate NZB files without storing the downloaded content.`,
ctx := context.Background()
if err := proc.ProcessNZB(ctx, nzbData.Nzb, checkPercent, missingPercent); err != nil {
slog.Error("Error processing NZB", "error", err)
// Ensure pool is closed before exiting
pool.Quit()
os.Exit(5)
}

// ensure clean shutdown of connection pool
pool.Quit()
},
}

Expand Down
Loading