Closed BatMiles closed 5 months ago
lol: https://github.com/the-markup/blacklight-collector/pull/40/files
If you're going to do this you should probably send the errors to sentry manually.
My thought in #40 was the uncaught error would cause the whole lambda to crash and thus you didn't need to clean up the browser. But if that's incorrect then yeah, something should be handling those.
My thought in #40 was the uncaught error would cause the whole lambda to crash and thus you didn't need to clean up the browser. But if that's incorrect then yeah, something should be handling those.
Yeah, the temporary files the browser creates don't get cleaned up unless you close the browser. There isn't a catch
here, so errors don't get handled. I think that'll leave them free to get to Sentry.
It appears the puppeteer browser was not always closing when the collector errored out. This adds a call to close the browser in a
finally
block, ensuring that it gets called and all puppeteer temporary files get cleaned up.