-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chunked Uploads #36
Chunked Uploads #36
Conversation
dd1d7bd
to
6ccbd6a
Compare
@@ -13,7 +13,7 @@ jobs: | |||
- name: Setup node | |||
uses: actions/setup-node@v3 | |||
with: | |||
node-version: "18" | |||
node-version: "20.12.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't change anything, just getting in line with our other projects.
spec: "@yarnpkg/plugin-typescript" | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.4.cjs | ||
yarnPath: .yarn/releases/yarn-4.5.0.cjs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgraded yarn to fix an eslint issue
export async function retry<T>(action: () => Promise<T>, retries = 2): Promise<T> { | ||
for (let i = 0; i <= retries; i++) { | ||
try { | ||
return await action(); | ||
} catch (error) { | ||
if (i + 1 > retries) { | ||
throw error; | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is used to automatically retry some upload calls. Those tend to be more susceptible to unexpected network errors since they are passing larger files. In many cases a failing asset creation call is hard to repeat later if we want it in the right spot in a kit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the actual update looks solid to me, but I'm not 100% sure how I would go about testing this since its related to the dev experience right? Not sure if you have thoughts on a solid way for me to whip something together to test this if you wanted me to triple make sure it chunks and uploads large assets for me as well!
Adds support for chunked uploads under the hood. This does not change the API at all. Uploads will automatically be chunked if the file exceeds 20mb.