From 443cf3fc26341f1d93afead99374fd85bc27136c Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 3 Sep 2021 13:44:19 -0700 Subject: [PATCH] Close extra browser instances too I'm seeing a lot of 500 "Could not load image: undefined" lately, not sure why! Wondering if it's resources staying open too long, idk. This should at least be better than leaving it open! --- api/assetImage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/assetImage.js b/api/assetImage.js index 97d8ebb..086eafc 100644 --- a/api/assetImage.js +++ b/api/assetImage.js @@ -122,8 +122,9 @@ async function loadAndScreenshotImage(libraryUrl, size) { ); } } finally { - // Close the page, to save on RAM in our shared browser instance. + // Tear down our resources when we're done! page.close(); + browser.close(); } }