feat: support recursive auto-upload (#62)

This commit is contained in:
Daniel Rochetti 2024-04-15 08:33:38 -07:00 committed by GitHub
parent dfeb8689f4
commit 9262814578
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 5 deletions

3
.gitignore vendored
View File

@ -40,4 +40,5 @@ Thumbs.db
# Next.js # Next.js
.next .next
*.local *.local
.vercel

View File

@ -1,7 +1,7 @@
{ {
"name": "@fal-ai/serverless-client", "name": "@fal-ai/serverless-client",
"description": "The fal serverless JS/TS client", "description": "The fal serverless JS/TS client",
"version": "0.9.1", "version": "0.9.2",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -121,6 +121,9 @@ export const storageImpl: StorageSupport = {
if (isPlainObject(value)) { if (isPlainObject(value)) {
return [key, await storageImpl.transformInput(value)]; return [key, await storageImpl.transformInput(value)];
} }
if (Array.isArray(value)) {
return [key, await Promise.all(value.map(storageImpl.transformInput))];
}
return [key, value] as KeyValuePair; return [key, value] as KeyValuePair;
}); });
const results = await Promise.all(promises); const results = await Promise.all(promises);

View File

@ -72,7 +72,7 @@ class FalStream<Input, Output> {
reject(error); reject(error);
}); });
}); });
this.start(); this.start().catch(this.handleError);
} }
private start = async () => { private start = async () => {
@ -145,8 +145,7 @@ class FalStream<Input, Output> {
this.emit( this.emit(
'error', 'error',
new ApiError({ new ApiError({
message: message: `Event stream timed out after ${(timeout / 1000).toFixed(0)} seconds with no messages.`,
'Event stream timed out after 15 seconds with no messages.',
status: 408, status: 408,
}) })
); );