Serverless function timeout concerns (#9689)
closes https://github.com/twentyhq/core-team-issues/issues/242 - unify timeout behavior between local and lambda - add timeout in serverless entity - set timeout default to 300s (5min)
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddTimeoutSecondsColumnToServerless1737047131108
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'AddTimeoutSecondsColumnToServerless1737047131108';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."serverlessFunction" ADD "timeoutSeconds" integer NOT NULL DEFAULT '300'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."serverlessFunction" ADD CONSTRAINT "CHK_4a5179975ee017934a91703247" CHECK ("timeoutSeconds" >= 1 AND "timeoutSeconds" <= 900)`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."serverlessFunction" DROP CONSTRAINT "CHK_4a5179975ee017934a91703247"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "metadata"."serverlessFunction" DROP COLUMN "timeoutSeconds"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user