Skip to content

Commit

Permalink
Await all lambda builds
Browse files Browse the repository at this point in the history
  • Loading branch information
cdalton713 committed Feb 19, 2024
1 parent be3d409 commit 0f52c0c
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions packages/sst/src/runtime/handlers.ts
Expand Up @@ -214,19 +214,18 @@ export const useFunctionBuilder = lazy(() => {
watcher.subscribe("file.changed", async (evt) => {
try {
const functions = useFunctions();
for (const [functionID, info] of Object.entries(functions.all)) {
const handler = handlers.for(info.runtime!);
if (
!handler?.shouldBuild({
functionID,
file: evt.properties.file,
})
)
continue;
await Promise.all(Object.entries(functions.all).map(async ([functionID, info]) => {
const handler = handlers.for(info.runtime);
if (!handler?.shouldBuild({
functionID,
file: evt.properties.file,
}))
return;
await result.build(functionID);
Logger.debug("Rebuilt function", functionID);
}
} catch {}
console.log("Rebuilt function", functionID);
}));
}
catch { }
});

return result;
Expand Down

0 comments on commit 0f52c0c

Please sign in to comment.