impress-2020/api
Matchu dfcd9985d4 Await closing Playwright before finish request
I noticed when loading Your Outfits earlier (before I switched it to just use prod images even on dev), that there was a big memory leak slowing down my machine.

My hypothesis is that this is because I wasn't _waiting_ for the resources to tear down before finishing the request, so Vercel terminated the request early, and I further hypothesize that terminating a Playwright session partway through isn't guaranteed to clean up the browser.

Not sure about that! Could have just been that we spun up a lot at once, and a bunch of things went into swap! (But I thought it generally handles requests in serial in the dev server? So that feels unlikely.)

Anyway, I don't feel like extensively testing this again and maybe messing up my computer session again :p Just, when I first wrote this without awaits, I knew that it was a bit risky, but I wanted to _see_ if it was a problem before slowing down individual requests by awaiting. And now, my "it's likely to be a problem" threshold has been reached, lol!

So, I'm not _confident_ this is the best play, I don't know the internals well enough; but it seems like a better side to err on than the other, now that I know more!
2021-09-03 15:43:27 -07:00
..
allWakaValues.js Trickier disabling honeycomb instrumentation 2021-08-08 00:23:57 -07:00
assetImage.js Await closing Playwright before finish request 2021-09-03 15:43:27 -07:00
graphql.js Trickier disabling honeycomb instrumentation 2021-08-08 00:23:57 -07:00
outfitImage.js Oops, right, 150 is a size too 2021-09-03 13:38:37 -07:00
outfitPageSSR.js Trickier disabling honeycomb instrumentation 2021-08-08 00:23:57 -07:00
sendFeedback.js Trickier disabling honeycomb instrumentation 2021-08-08 00:23:57 -07:00
uploadLayerImage.js Trickier disabling honeycomb instrumentation 2021-08-08 00:23:57 -07:00
validPetPoses.js Trickier disabling honeycomb instrumentation 2021-08-08 00:23:57 -07:00