Remove build lambda at creation (#11531)
Remove useless build call (done at first execution)
This commit is contained in:
@ -17,7 +17,6 @@ export type ServerlessExecuteResult = {
|
|||||||
|
|
||||||
export interface ServerlessDriver {
|
export interface ServerlessDriver {
|
||||||
delete(serverlessFunction: ServerlessFunctionEntity): Promise<void>;
|
delete(serverlessFunction: ServerlessFunctionEntity): Promise<void>;
|
||||||
build(serverlessFunction: ServerlessFunctionEntity): Promise<void>;
|
|
||||||
execute(
|
execute(
|
||||||
serverlessFunction: ServerlessFunctionEntity,
|
serverlessFunction: ServerlessFunctionEntity,
|
||||||
payload: object,
|
payload: object,
|
||||||
|
|||||||
@ -217,7 +217,7 @@ export class LambdaDriver implements ServerlessDriver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async build(serverlessFunction: ServerlessFunctionEntity) {
|
private async build(serverlessFunction: ServerlessFunctionEntity) {
|
||||||
const lambdaExecutor = await this.getLambdaExecutor(serverlessFunction);
|
const lambdaExecutor = await this.getLambdaExecutor(serverlessFunction);
|
||||||
|
|
||||||
if (isDefined(lambdaExecutor)) {
|
if (isDefined(lambdaExecutor)) {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ export class LocalDriver implements ServerlessDriver {
|
|||||||
|
|
||||||
async delete() {}
|
async delete() {}
|
||||||
|
|
||||||
async build(serverlessFunction: ServerlessFunctionEntity) {
|
private async build(serverlessFunction: ServerlessFunctionEntity) {
|
||||||
await this.createLayerIfNotExists(serverlessFunction.layerVersion);
|
await this.createLayerIfNotExists(serverlessFunction.layerVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,10 +16,6 @@ export class ServerlessService implements ServerlessDriver {
|
|||||||
return this.driver.delete(serverlessFunction);
|
return this.driver.delete(serverlessFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
async build(serverlessFunction: ServerlessFunctionEntity): Promise<void> {
|
|
||||||
return this.driver.build(serverlessFunction);
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute(
|
async execute(
|
||||||
serverlessFunction: ServerlessFunctionEntity,
|
serverlessFunction: ServerlessFunctionEntity,
|
||||||
payload: object,
|
payload: object,
|
||||||
|
|||||||
@ -347,8 +347,6 @@ export class ServerlessFunctionService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.serverlessService.build(createdServerlessFunction);
|
|
||||||
|
|
||||||
return this.serverlessFunctionRepository.findOneBy({
|
return this.serverlessFunctionRepository.findOneBy({
|
||||||
id: createdServerlessFunction.id,
|
id: createdServerlessFunction.id,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user