Skip to content

Instantly share code, notes, and snippets.

@vpontis
Created August 12, 2021 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpontis/84b79108c4ffacbcf146e5bf6e77661e to your computer and use it in GitHub Desktop.
Save vpontis/84b79108c4ffacbcf146e5bf6e77661e to your computer and use it in GitHub Desktop.
diff --git a/next/utils/upload-file-to-s3.ts b/next/utils/upload-file-to-s3.ts
index c8374943b..5e9d4ef37 100644
--- a/next/utils/upload-file-to-s3.ts
+++ b/next/utils/upload-file-to-s3.ts
@@ -1,4 +1,4 @@
-import { S3Bucket, S3FolderName } from "@luma-team/shared";
+import { S3Bucket, S3FolderName, sleep } from "@luma-team/shared";
import axios from "axios";
import { ZmClient } from "./ZmClient";
@@ -26,8 +26,11 @@ export const uploadFileToS3 = async ({
throw new FileTooBigError();
}
+ await sleep(10_000);
+
const { upload_url, file_url, file_key } = await ZmClient.post(
- "/cdn/create-presigned-url", {
+ "/cdn/create-presigned-url",
+ {
folder,
contentType: file.type,
bucket,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment