-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1430 from remotion-dev/lift-lambda-payload-limit
- Loading branch information
Showing
18 changed files
with
239 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/lambda/src/shared/cleanup-serialized-input-props.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type {AwsRegion} from '../client'; | ||
import {lambdaDeleteFile} from '../functions/helpers/io'; | ||
import type {SerializedInputProps} from './constants'; | ||
import {inputPropsKey} from './constants'; | ||
|
||
export const cleanupSerializedInputProps = async ({ | ||
serialized, | ||
region, | ||
bucketName, | ||
}: { | ||
serialized: SerializedInputProps; | ||
region: AwsRegion; | ||
bucketName: string; | ||
}): Promise<number> => { | ||
if (serialized.type === 'payload') { | ||
return 0; | ||
} | ||
|
||
const time = Date.now(); | ||
await lambdaDeleteFile({ | ||
bucketName, | ||
key: inputPropsKey(serialized.hash), | ||
region, | ||
customCredentials: null, | ||
}); | ||
|
||
return Date.now() - time; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type {AwsRegion} from '../client'; | ||
import {lambdaReadFile} from '../functions/helpers/io'; | ||
import type {SerializedInputProps} from './constants'; | ||
import {inputPropsKey} from './constants'; | ||
import {streamToString} from './stream-to-string'; | ||
|
||
export const deserializeInputProps = async ({ | ||
serialized, | ||
region, | ||
bucketName, | ||
expectedBucketOwner, | ||
}: { | ||
serialized: SerializedInputProps; | ||
region: AwsRegion; | ||
bucketName: string; | ||
expectedBucketOwner: string; | ||
}): Promise<unknown> => { | ||
if (serialized.type === 'payload') { | ||
return { | ||
inputProps: serialized.payload, | ||
}; | ||
} | ||
|
||
try { | ||
const response = await lambdaReadFile({ | ||
bucketName, | ||
expectedBucketOwner, | ||
key: inputPropsKey(serialized.hash), | ||
region, | ||
}); | ||
|
||
const body = await streamToString(response); | ||
const payload = JSON.parse(body); | ||
|
||
return payload; | ||
} catch (err) { | ||
throw new Error('Failed to parse input props that were'); | ||
} | ||
}; |
Oops, something went wrong.
f4a8bb3
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.
Successfully deployed to the following URLs:
remotion – ./
remotion-remotion.vercel.app
remotion-git-main-remotion.vercel.app
remotion.vercel.app
v3.remotion.dev
www.remotion.dev
remotion.dev
www.remotiondocs.com
remotiondocs.com