Poc lambda deployment duration (#10340)
closes https://github.com/twentyhq/core-team-issues/issues/436 ## Acheivements Improve aws lambda deployment time from ~10/15 secs to less that 1 sec ## Done - migrate with the new code executor architecture for local and lambda drivers - support old and new executor architecture to avoid breaking changes - first run is long, next runs are quick even if code step is updated ## Demo using `lambda` driver ### Before https://github.com/user-attachments/assets/7f7664b4-658f-4689-8949-ea2c31131252 ### After https://github.com/user-attachments/assets/d486c8e2-f8f8-4dbd-a801-c9901e440b29
This commit is contained in:
@ -81,8 +81,6 @@ export const WorkflowEditActionFormServerlessFunction = ({
|
||||
}: WorkflowEditActionFormServerlessFunctionProps) => {
|
||||
const theme = useTheme();
|
||||
const { getIcon } = useIcons();
|
||||
const [shouldBuildServerlessFunction, setShouldBuildServerlessFunction] =
|
||||
useState(false);
|
||||
const serverlessFunctionId = action.settings.input.serverlessFunctionId;
|
||||
const serverlessFunctionVersion =
|
||||
action.settings.input.serverlessFunctionVersion;
|
||||
@ -123,14 +121,12 @@ export const WorkflowEditActionFormServerlessFunction = ({
|
||||
});
|
||||
};
|
||||
|
||||
const { testServerlessFunction, isTesting, isBuilding } =
|
||||
useTestServerlessFunction({
|
||||
serverlessFunctionId,
|
||||
callback: updateOutputSchemaFromTestResult,
|
||||
});
|
||||
const { testServerlessFunction, isTesting } = useTestServerlessFunction({
|
||||
serverlessFunctionId,
|
||||
callback: updateOutputSchemaFromTestResult,
|
||||
});
|
||||
|
||||
const handleSave = useDebouncedCallback(async () => {
|
||||
setShouldBuildServerlessFunction(true);
|
||||
await updateOneServerlessFunction({
|
||||
name: formValues.name,
|
||||
description: formValues.description,
|
||||
@ -238,8 +234,7 @@ export const WorkflowEditActionFormServerlessFunction = ({
|
||||
}
|
||||
|
||||
if (!isTesting) {
|
||||
await testServerlessFunction(shouldBuildServerlessFunction);
|
||||
setShouldBuildServerlessFunction(false);
|
||||
await testServerlessFunction();
|
||||
}
|
||||
};
|
||||
|
||||
@ -348,7 +343,6 @@ export const WorkflowEditActionFormServerlessFunction = ({
|
||||
<InputLabel>Result</InputLabel>
|
||||
<ServerlessFunctionExecutionResult
|
||||
serverlessFunctionTestData={serverlessFunctionTestData}
|
||||
isBuilding={isBuilding}
|
||||
isTesting={isTesting}
|
||||
/>
|
||||
</StyledCodeEditorContainer>
|
||||
@ -361,7 +355,7 @@ export const WorkflowEditActionFormServerlessFunction = ({
|
||||
<CmdEnterActionButton
|
||||
title="Test"
|
||||
onClick={handleRunFunction}
|
||||
disabled={isTesting || isBuilding || actionOptions.readonly}
|
||||
disabled={isTesting || actionOptions.readonly}
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user