perf(aws-lambda): warm the audio function while the plan runs (#6148)

* perf(aws-lambda): warm the audio function while the plan runs

The audio task runs on the x86 render function, which is cold when the plan ran on the arm64 video function. A fire-and-forget invoke at the start of a render now wakes it, so the audio no longer outlasts the chunks.

* perf(aws-lambda): warm the render function only on a stack with a video function

An x86-only stack has no cold function to warm, so it takes the old path with no extra step. The CDK stack has no video function and is unchanged.

* perf(aws-lambda): wrap a template comment

* style(aws-lambda): format the warm-up template test
This commit is contained in:
Miguel Ángel
2026-10-23 19:32:57 +00:00
committed by GitHub
parent 9fe0511c2e
commit fb2f7c1a80
5 changed files with 71 additions and 3 deletions
+13
View File
@@ -255,6 +255,19 @@ describe("unwrapEvent", () => {
});
describe("handler dispatch", () => {
it("answers a warm event without touching S3 or the project", async () => {
const s3 = new FakeS3Client();
expect(
await handleEvent(
{ Action: "warm" },
{ s3: s3 as unknown as import("@aws-sdk/client-s3").S3Client, skipChromeResolution: true },
),
).toEqual({
Action: "warm",
});
expect(s3.ops).toEqual([]);
});
it("preserves explicit v1 plan compatibility", async () => {
const tmpRoot = makeTmpRoot();
const s3 = new FakeS3Client();