Free memory after extracting comic

This commit is contained in:
Nicholas Wallace 2024-08-19 22:05:25 -07:00
parent 4de65b4369
commit 9c87c3a095

View File

@ -50,6 +50,9 @@ async function extractCoverImage(comicPath, comicImageFilepath, outputCoverPath)
} catch (error) {
Logger.error(`[parseComicMetadata] Failed to extract image from comicPath "${comicPath}"`, error)
return false
} finally {
// Ensure we free the memory
archive.close()
}
}
module.exports.extractCoverImage = extractCoverImage
@ -104,6 +107,9 @@ async function parse(ebookFile) {
Logger.warn(`Cover image not found in comic at "${comicPath}"`)
}
// Ensure we close the archive to free memory
archive.close()
return payload
}
module.exports.parse = parse