|
@@ -8,17 +8,7 @@ ALL_IDS = ID_RANGE.to_a
|
|
QUERIES_MIN = 1
|
|
QUERIES_MIN = 1
|
|
QUERIES_MAX = 500
|
|
QUERIES_MAX = 500
|
|
SEQUEL_NO_ASSOCIATIONS = true
|
|
SEQUEL_NO_ASSOCIATIONS = true
|
|
-
|
|
|
|
-SERVER_STRING =
|
|
|
|
- if defined?(PhusionPassenger)
|
|
|
|
- 'passenger'
|
|
|
|
- elsif defined?(Puma)
|
|
|
|
- 'puma'
|
|
|
|
- elsif defined?(Unicorn)
|
|
|
|
- 'unicorn'
|
|
|
|
- elsif defined?(Iodine)
|
|
|
|
- 'iodine'
|
|
|
|
- end
|
|
|
|
|
|
+SERVER_STRING = "Sinatra"
|
|
|
|
|
|
Bundler.require(:default) # Load core modules
|
|
Bundler.require(:default) # Load core modules
|
|
|
|
|
|
@@ -33,13 +23,10 @@ def connect(dbtype)
|
|
opts = {}
|
|
opts = {}
|
|
|
|
|
|
# Determine threading/thread pool size and timeout
|
|
# Determine threading/thread pool size and timeout
|
|
- if defined?(JRUBY_VERSION)
|
|
|
|
- opts[:max_connections] = (2 * Math.log(Integer(ENV.fetch('MAX_CONCURRENCY')))).floor
|
|
|
|
- opts[:pool_timeout] = 10
|
|
|
|
- elsif defined?(Puma) && (threads = Puma.cli_config.options.fetch(:max_threads)) > 1
|
|
|
|
|
|
+ if defined?(Puma) && (threads = Puma.cli_config.options.fetch(:max_threads)) > 1
|
|
opts[:max_connections] = (2 * Math.log(threads)).floor
|
|
opts[:max_connections] = (2 * Math.log(threads)).floor
|
|
opts[:pool_timeout] = 10
|
|
opts[:pool_timeout] = 10
|
|
- elsif defined?(Unicorn) || defined?(Passenger)
|
|
|
|
|
|
+ elsif defined?(Unicorn)
|
|
Sequel.single_threaded = true
|
|
Sequel.single_threaded = true
|
|
end
|
|
end
|
|
|
|
|