From 8d6db630d47802e5a1ae40c9882d5d2c446dec14 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Tue, 21 Jan 2025 18:26:12 -0800 Subject: [PATCH] Fix channel initialization --- cv/cv.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cv/cv.go b/cv/cv.go index 1574a73..457d4d0 100644 --- a/cv/cv.go +++ b/cv/cv.go @@ -574,10 +574,7 @@ func NewCVDownloader(ctx context.Context, bufPool *sync.Pool, chdb ch.CHDB, work JSONPath: filepath.Join(workPath, "_json"), ImagePath: filepath.Join(workPath, "_image"), APIKey: APIKey, - downloadQueue: make(chan *CVResult, 100), // This is just json it shouldn't take up much more than 122 MB - imageDownloads: make(chan download, 1), // These are just URLs should only take a few MB - notFound: make(chan download, 1), // Same here - bufPool: bufPool, // Only used if keepDownloadedImages is false to save space on byte buffers. The buffers get sent back via finishedDownloadQueue + bufPool: bufPool, // Only used if keepDownloadedImages is false to save space on byte buffers. The buffers get sent back via finishedDownloadQueue FinishedDownloadQueue: finishedDownloadQueue, SendExistingImages: sendExistingImages, KeepDownloadedImages: keepDownloadedImages, @@ -590,6 +587,9 @@ func DownloadCovers(c *CVDownloader) { var ( err error ) + c.downloadQueue = make(chan *CVResult, 100) // This is just json it shouldn't take up much more than 122 MB + c.imageDownloads = make(chan download, 1) // These are just URLs should only take a few MB + c.notFound = make(chan download, 1) // Same here os.MkdirAll(c.JSONPath, 0o777) f, _ := os.Create(filepath.Join(c.ImagePath, ".keep")) f.Close()