Serverless function follow up (#9924)
- remove asynchronous serverless function build - build serverless function synchronously instead on activate workflow or execute - add a loader on workflow code step test tab test button - add a new `ServerlessFunctionSyncStatus` `BUILDING` - add a new route to build a serverless function draft version - delay artificially execution to avoid UI flashing https://github.com/user-attachments/assets/8d958d9a-ef41-4261-999e-6ea374191e33
This commit is contained in:
@ -54,7 +54,7 @@ import { compileTypescript } from 'src/engine/core-modules/serverless/drivers/ut
|
||||
import { ENV_FILE_NAME } from 'src/engine/core-modules/serverless/drivers/constants/env-file-name';
|
||||
import { OUTDIR_FOLDER } from 'src/engine/core-modules/serverless/drivers/constants/outdir-folder';
|
||||
|
||||
const UPDATE_FUNCTION_DURATION_TIMEOUT_IN_SECONDS = 30;
|
||||
const UPDATE_FUNCTION_DURATION_TIMEOUT_IN_SECONDS = 60;
|
||||
|
||||
export interface LambdaDriverOptions extends LambdaClientConfig {
|
||||
fileStorageService: FileStorageService;
|
||||
@ -133,7 +133,7 @@ export class LambdaDriver implements ServerlessDriver {
|
||||
await lambdaBuildDirectoryManager.clean();
|
||||
|
||||
if (!isDefined(result.LayerVersionArn)) {
|
||||
throw new Error('new layer version arn si undefined');
|
||||
throw new Error('new layer version arn if undefined');
|
||||
}
|
||||
|
||||
return result.LayerVersionArn;
|
||||
@ -177,15 +177,13 @@ export class LambdaDriver implements ServerlessDriver {
|
||||
return join(SERVERLESS_TMPDIR_FOLDER, serverlessFunction.id, version);
|
||||
};
|
||||
|
||||
async build(serverlessFunction: ServerlessFunctionEntity, version: string) {
|
||||
const computedVersion =
|
||||
version === 'latest' ? serverlessFunction.latestVersion : version;
|
||||
async build(serverlessFunction: ServerlessFunctionEntity, version: 'draft') {
|
||||
if (version !== 'draft') {
|
||||
throw new Error("We can only build 'draft' version with lambda driver");
|
||||
}
|
||||
|
||||
const inMemoryServerlessFunctionFolderPath =
|
||||
this.getInMemoryServerlessFunctionFolderPath(
|
||||
serverlessFunction,
|
||||
computedVersion,
|
||||
);
|
||||
this.getInMemoryServerlessFunctionFolderPath(serverlessFunction, version);
|
||||
|
||||
const folderPath = getServerlessFolder({
|
||||
serverlessFunction,
|
||||
|
||||
Reference in New Issue
Block a user