Fix channel initialization
This commit is contained in:
parent
29f58e7fe7
commit
8d6db630d4
8
cv/cv.go
8
cv/cv.go
@ -574,10 +574,7 @@ func NewCVDownloader(ctx context.Context, bufPool *sync.Pool, chdb ch.CHDB, work
|
|||||||
JSONPath: filepath.Join(workPath, "_json"),
|
JSONPath: filepath.Join(workPath, "_json"),
|
||||||
ImagePath: filepath.Join(workPath, "_image"),
|
ImagePath: filepath.Join(workPath, "_image"),
|
||||||
APIKey: APIKey,
|
APIKey: APIKey,
|
||||||
downloadQueue: make(chan *CVResult, 100), // This is just json it shouldn't take up much more than 122 MB
|
bufPool: bufPool, // Only used if keepDownloadedImages is false to save space on byte buffers. The buffers get sent back via finishedDownloadQueue
|
||||||
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
|
|
||||||
FinishedDownloadQueue: finishedDownloadQueue,
|
FinishedDownloadQueue: finishedDownloadQueue,
|
||||||
SendExistingImages: sendExistingImages,
|
SendExistingImages: sendExistingImages,
|
||||||
KeepDownloadedImages: keepDownloadedImages,
|
KeepDownloadedImages: keepDownloadedImages,
|
||||||
@ -590,6 +587,9 @@ func DownloadCovers(c *CVDownloader) {
|
|||||||
var (
|
var (
|
||||||
err error
|
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)
|
os.MkdirAll(c.JSONPath, 0o777)
|
||||||
f, _ := os.Create(filepath.Join(c.ImagePath, ".keep"))
|
f, _ := os.Create(filepath.Join(c.ImagePath, ".keep"))
|
||||||
f.Close()
|
f.Close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user