Maybe fix PNG upload bug in prod?

My hypothesis is that this missing `await` is causing prod Vercel to cut off the request before the async upload finishes. Omitting this `await` was a mistake, so I'm just adding it right in!

I also add logging for the success case. That way, if this isn't actually a fix, I can at least watch the logs and confirm whether the app thinks it's getting to here.
This commit is contained in:
Emi Matchu 2020-08-05 14:03:14 -07:00
parent b520d1095c
commit 197dfd4e11

View file

@ -38,7 +38,8 @@ async function processImage(assetType, remoteId, size, imageData) {
const id3 = paddedId.slice(6, 9); const id3 = paddedId.slice(6, 9);
const key = `${assetType}/${id1}/${id2}/${id3}/${remoteId}/${size}x${size}.png`; const key = `${assetType}/${id1}/${id2}/${id3}/${remoteId}/${size}x${size}.png`;
upload("impress-asset-images", key, imageData); await upload("impress-asset-images", key, imageData);
console.log(`Successfully uploaded ${key} to impress-asset-images`);
} }
export default async (req, res) => { export default async (req, res) => {