Skip to content
This repository was archived by the owner on Sep 21, 2025. It is now read-only.

Commit 616e695

Browse files
author
John Carlyle-Clarke
committed
SRE-xxx: Add env var to disable statement_timeout
Adds a `DISABLE_DATABASE_STATEMENT_TIMEOUT` env var to prevent enforcing a `statement_timeout` in the DB config. The previous behaviour conflicts with PGBouncer and cannot be disabled.
1 parent 29d664e commit 616e695

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
# v1.23.0 (2019-04-24)
2+
3+
Features:
4+
5+
- Adds a `DISABLE_DATABASE_STATEMENT_TIMEOUT` env var to prevent enforcing a `statement_timeout` in the DB config.
6+
The previous behaviour conflicts with PGBouncer and cannot be disabled.
7+
18
# v1.22.0 (2018-08-29)
29

310
Features:
411

5-
- Allows specifiying `BASE_NEW_RELIC_APP_NAME` instead of `NEW_RELIC_APP_NAME`, which reports to New Relic per Hopper service.
12+
- Allows specifying `BASE_NEW_RELIC_APP_NAME` instead of `NEW_RELIC_APP_NAME`, which reports to New Relic per Hopper service.
613

714
# v1.21.0 (2018-03-27)
815

lib/roo_on_rails/railties/database.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ class Database < Rails::Railtie
88

99
config = ActiveRecord::Base.configurations[Rails.env]
1010
config['variables'] ||= {}
11-
config['variables']['statement_timeout'] = ENV.fetch('DATABASE_STATEMENT_TIMEOUT', 200)
11+
if ['1', 'yes', 'true'].include?(ENV.fetch('DISABLE_DATABASE_STATEMENT_TIMEOUT', 'false').downcase)
12+
config['variables']['statement_timeout'] = ENV.fetch('DATABASE_STATEMENT_TIMEOUT', 200)
13+
end
1214
if ENV.key?('DATABASE_REAPING_FREQUENCY')
1315
config['reaping_frequency'] = ENV['DATABASE_REAPING_FREQUENCY']
1416
end

lib/roo_on_rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module RooOnRails
2-
VERSION = '1.22.0'.freeze
2+
VERSION = '1.23.0'.freeze
33
end

roo_on_rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
3838
spec.add_runtime_dependency 'routemaster-client'
3939
spec.add_runtime_dependency 'json-jwt', '~> 1.8'
4040

41-
spec.add_development_dependency 'bundler', '~> 1.13'
41+
spec.add_development_dependency 'bundler', '~> 2.0.1'
4242
spec.add_development_dependency 'rake', '~> 10.0'
4343
spec.add_development_dependency 'rspec', '~> 3.0'
4444
spec.add_development_dependency 'thor', '~> 0.19'

0 commit comments

Comments
 (0)