-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #522 from IKatsuba/fix-long-runs-end
fix(api): fix performance issue for /runs/end
- Loading branch information
Showing
8 changed files
with
86 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Migration } from '@mikro-orm/migrations'; | ||
|
||
export class Migration20240507084336 extends Migration { | ||
async up(): Promise<void> { | ||
this.addSql( | ||
'create index "task_entity_hash_index" on "task_entity" ("hash");' | ||
); | ||
} | ||
|
||
async down(): Promise<void> { | ||
this.addSql('drop index "task_entity_hash_index";'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { MikroORM } from '@mikro-orm/core'; | ||
import { NestFactory } from '@nestjs/core'; | ||
import { AppModule } from '../apps/api/src/app/app.module'; | ||
import { Logger } from 'nestjs-pino'; | ||
|
||
(async () => { | ||
const app = await NestFactory.create(AppModule, { | ||
autoFlushLogs: true, | ||
bufferLogs: true, | ||
}); | ||
|
||
const logger = app.get(Logger); | ||
|
||
app.useLogger(logger); | ||
|
||
logger.log('Starting migrations...'); | ||
|
||
const orm = app.get(MikroORM); | ||
|
||
const migrator = orm.getMigrator(); | ||
await migrator.createMigration(); | ||
|
||
logger.log('Migrations created.'); | ||
|
||
await orm.close(true); | ||
})().catch((e) => { | ||
console.error(e); | ||
}); |