Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ gem 'ar_lazy_preload', '~> 2.0'
gem 'strong_migrations'
gem 'verbose_migrations'
gem 'temporary_tables'
gem 'statement_timeout'
gem 'statement_timeout', '~> 1.1'
gem 'union_of'
gem 'order_as_specified'

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
stackprof (0.2.26)
statement_timeout (1.0.0)
statement_timeout (1.1.0)
rails (>= 6.0)
statsd-ruby (1.5.0)
stringio (3.1.7)
Expand Down Expand Up @@ -617,7 +617,7 @@ DEPENDENCIES
sidekiq-cronitor (~> 3.6.0)
sprockets (~> 3.0)
stackprof
statement_timeout
statement_timeout (~> 1.1)
stripe (~> 5.43)
stripe-ruby-mock!
strong_migrations
Expand Down
2 changes: 1 addition & 1 deletion app/workers/vacuum_analyze_event_logs_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class VacuumAnalyzeEventLogsWorker < BaseWorker
cronitor_disabled: false

def perform
EventLog.statement_timeout(STATEMENT_TIMEOUT) do |conn|
EventLog.statement_timeout(STATEMENT_TIMEOUT, mode: :session) do |conn|
conn.execute 'VACUUM ANALYZE event_logs'
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/workers/vacuum_analyze_metrics_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class VacuumAnalyzeMetricsWorker < BaseWorker
cronitor_disabled: false

def perform
Metric.statement_timeout(STATEMENT_TIMEOUT) do |conn|
Metric.statement_timeout(STATEMENT_TIMEOUT, mode: :session) do |conn|
conn.execute 'VACUUM ANALYZE metrics'
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/workers/vacuum_analyze_request_logs_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class VacuumAnalyzeRequestLogsWorker < BaseWorker
cronitor_disabled: false

def perform
RequestLog.statement_timeout(STATEMENT_TIMEOUT) do |conn|
RequestLog.statement_timeout(STATEMENT_TIMEOUT, mode: :session) do |conn|
conn.execute 'VACUUM ANALYZE request_logs'
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/workers/vacuum_analyze_webhook_events_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class VacuumAnalyzeWebhookEventsWorker < BaseWorker
cronitor_disabled: false

def perform
WebhookEvent.statement_timeout(STATEMENT_TIMEOUT) do |conn|
WebhookEvent.statement_timeout(STATEMENT_TIMEOUT, mode: :session) do |conn|
conn.execute 'VACUUM ANALYZE webhook_events'
end
end
Expand Down
5 changes: 5 additions & 0 deletions config/initializers/statement_timeout.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

StatementTimeout.configure do |config|
config.default_mode = :transaction # for pgbouncer
end