Skip to content

Commit 2e82286

Browse files
authored
Merge pull request #20482 from opf/chore/do-not-log-slow-sql-for-db-creation
Avoid logging slow SQL for tenant creation
2 parents 8b7596e + b3992d9 commit 2e82286

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

config/initializers/log_slow_sql_queries.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
# Skip transaction that may be blocked
4343
next if data[:sql].match?(/BEGIN|COMMIT/)
4444

45+
# Skip tenant creation (load dump)
46+
next if data[:sql][..120].include?("Dumped by pg_dump")
47+
4548
# Skip smaller durations
4649
duration = ((finish - start) * 1000).round(4)
4750
next if duration <= slow_sql_threshold

0 commit comments

Comments
 (0)