Skip to content

Commit 58749c5

Browse files
committed
Fix logic
1 parent cba9a92 commit 58749c5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

plugins/query-log/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,17 @@ export class QueryLogPlugin extends StarbasePlugin {
8888
this.state.endTime.getTime() - this.state.startTime.getTime()
8989

9090
// Queries can be omitted from
91-
if (
92-
opts.dataSource &&
93-
!opts.sql.toUpperCase().trim().startsWith(this.omitPrefix) &&
94-
this.omitEnabled
95-
) {
96-
this.addQuery(opts?.dataSource)
91+
if (opts.dataSource) {
92+
if (
93+
(this.omitEnabled &&
94+
!opts.sql
95+
.toUpperCase()
96+
.trim()
97+
.startsWith(this.omitPrefix)) ||
98+
!this.omitEnabled
99+
) {
100+
this.addQuery(opts?.dataSource)
101+
}
97102
}
98103

99104
// Do a purge action for older than TTL items

0 commit comments

Comments
 (0)