Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Rename some configuration variables #223

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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 .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ RACK_ENV=development
TZ=Europe/Prague
RAISE_ERRORS=true
FORCE_SSL=false
TIMEOUT=false
RACK_TIMEOUT=false
DOMAIN=example.com
SYNC_SCHEDULE=0 */12 * * *
3 changes: 0 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ require 'pliny/tasks'
Dir['./lib/tasks/*.rake'].each { |task| load task }

task :default => :spec



6 changes: 3 additions & 3 deletions config/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ module Config

# Override -- value is returned or the set default.
override :database_timeout, 10, int
override :db_pool, 5, int
override :db_pool_max_size, 3, int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any explanation for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already use 3 on production for a long time, because 5 is too many – this value is per process and Puma spawns multiple processes.

override :deployment, 'production', string
override :elastic_prefix, 'sirius', string
override :force_ssl, true, bool
override :oauth_check_token_uri, 'https://auth.fit.cvut.cz/oauth/oauth/check_token', string
override :oauth_auth_uri, 'https://auth.fit.cvut.cz/oauth/authorize', string
override :oauth_token_uri, 'https://auth.fit.cvut.cz/oauth/token', string
override :umapi_people_uri, 'https://kosapi.fit.cvut.cz/usermap/v1/people', string
override :umapi_privileged_roles, 'B-00000-ZAMESTNANEC', array(string)
override :umapi_privileged_roles, 'B-00000-SUMA-ZAMESTNANEC', array(string)

override :port, 5000, int
override :pretty_json, false, bool
override :rack_env, 'development', string
override :raise_errors, false, bool
override :root, File.expand_path('../', __dir__), string
override :timeout, 10, int
override :rack_timeout, 10, int
override :tz, 'Europe/Prague', string
override :versioning, false, bool

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# while Sequel expects 'postgres' adapter
db_url = Config.database_url.sub(/\Apostgresql:/, 'postgres:')

DB = Sequel.connect(db_url, max_connections: Config.db_pool)
DB = Sequel.connect(db_url, max_connections: Config.db_pool_max_size)

# Log level at which to log SQL queries.
DB.sql_log_level = :debug
Expand Down
6 changes: 4 additions & 2 deletions config/initializers/timeout.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require 'logger'
require 'rack-timeout'

if Config.timeout > 0
Rack::Timeout.timeout = Config.timeout
if Config.rack_timeout > 0
Rack::Timeout.timeout = Config.rack_timeout
Rack::Timeout::Logger.level = Logger::WARN
end
2 changes: 1 addition & 1 deletion lib/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Routes = Rack::Builder.new do
use Pliny::Middleware::RescueErrors, raise: Config.raise_errors?
use Pliny::Middleware::CORS
use Rack::Timeout if Config.timeout > 0
use Rack::Timeout if Config.rack_timeout > 0
use Raven::Rack if Config.sentry_dsn
use Rack::Deflater
use Rack::MethodOverride
Expand Down
1 change: 0 additions & 1 deletion vagga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,3 @@ commands:
children:
postgres: *postgres
elastic: *elastic