test(backend): fix unit tests for media magic validation, slow query logger, and support chat specs
Deploy Canina / deploy (push) Successful in 41s
Deploy Canina / deploy (push) Successful in 41s
This commit is contained in:
1 parent
dda1caf3e0
commit
7f2f638f38
8 files changed
+42
-23
No files matched your search
@@ -24,13 +24,15 @@ export class PrismaService
|
||||
await this.$connect();
|
||||
|
||||
// BE-07: Slow query logging interceptor (> 300ms)
|
||||
(this as any).$on("query", (e: any) => {
|
||||
if (typeof (this as any).$on === "function") {
|
||||
(this as any).$on("query", (e: any) => {
|
||||
if (e.duration >= 300) {
|
||||
this.logger.warn(
|
||||
`[SlowQueryAlert] Duration: ${e.duration}ms | Target: ${e.target} | Query: ${e.query.substring(0, 300)}...`,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
await this.ensureTablesExist();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user