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

Commit a8f2850

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 a8f2850

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ 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+
disable_set_timeout = ['1', 'yes', 'true'].include?(ENV.fetch('DISABLE_DATABASE_STATEMENT_TIMEOUT', 'false').downcase)
12+
if not disable_set_timeout
13+
config['variables']['statement_timeout'] = ENV.fetch('DATABASE_STATEMENT_TIMEOUT', 200)
14+
end
1215
if ENV.key?('DATABASE_REAPING_FREQUENCY')
1316
config['reaping_frequency'] = ENV['DATABASE_REAPING_FREQUENCY']
1417
end
15-
1618
ActiveRecord::Base.establish_connection
1719
end
1820
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)