diff --git a/frameworks/Ruby/rage/Gemfile b/frameworks/Ruby/rage/Gemfile index 96d6e7042fc..89c3affcb58 100644 --- a/frameworks/Ruby/rage/Gemfile +++ b/frameworks/Ruby/rage/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "rage-rb", "~> 1.3" +gem "rage-rb", "~> 1.10" gem "pg", "~> 1.0" gem "activerecord", "~> 7.2.0", require: "active_record" diff --git a/frameworks/Ruby/rage/app/models/fortune.rb b/frameworks/Ruby/rage/app/models/fortune.rb index 6b7ad122f80..0080d6363c4 100644 --- a/frameworks/Ruby/rage/app/models/fortune.rb +++ b/frameworks/Ruby/rage/app/models/fortune.rb @@ -1,7 +1,3 @@ class Fortune < ApplicationRecord self.table_name = "Fortune" - - def as_json(*) - attributes - end end diff --git a/frameworks/Ruby/rage/app/models/world.rb b/frameworks/Ruby/rage/app/models/world.rb index 951aab55b64..836783137c6 100644 --- a/frameworks/Ruby/rage/app/models/world.rb +++ b/frameworks/Ruby/rage/app/models/world.rb @@ -1,9 +1,5 @@ class World < ApplicationRecord self.table_name = "World" - def as_json(*) - attributes - end - alias_attribute(:randomNumber, :randomnumber) end diff --git a/frameworks/Ruby/rage/config.ru b/frameworks/Ruby/rage/config.ru index 52de8a40479..049a1ad509d 100644 --- a/frameworks/Ruby/rage/config.ru +++ b/frameworks/Ruby/rage/config.ru @@ -1,4 +1,3 @@ require_relative "config/application" run Rage.application -Rage.load_middlewares(self) diff --git a/frameworks/Ruby/rage/config/initializers/activerecord.rb b/frameworks/Ruby/rage/config/initializers/activerecord.rb index c0e3eb08d44..34a3b019a66 100644 --- a/frameworks/Ruby/rage/config/initializers/activerecord.rb +++ b/frameworks/Ruby/rage/config/initializers/activerecord.rb @@ -2,16 +2,7 @@ require "etc" -connection = { - adapter: "postgresql", - host: "tfb-database", - username: "benchmarkdbuser", - password: "benchmarkdbpass", - database: "hello_world", - reaping_frequency: 0, - pool: (2 * Math.log(256 / Etc.nprocessors)).floor -} +pool_size = (2 * Math.log(256 / Etc.nprocessors)).floor +puts "ActiveRecord pool size: #{pool_size}" -puts "ActiveRecord connection options: #{connection.inspect}" - -ActiveRecord::Base.establish_connection(connection) +ENV["DATABASE_URL"]="postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world?pool=#{pool_size}&reaping_frequency=0" diff --git a/frameworks/Ruby/rage/rage.dockerfile b/frameworks/Ruby/rage/rage.dockerfile index bbacb344f29..6c65b51fba4 100644 --- a/frameworks/Ruby/rage/rage.dockerfile +++ b/frameworks/Ruby/rage/rage.dockerfile @@ -8,7 +8,6 @@ RUN bundle install --jobs=8 COPY . /rage ENV RUBY_YJIT_ENABLE=1 -ENV RAGE_PATCH_AR_POOL=1 ENV BUNDLE_FORCE_RUBY_PLATFORM=true CMD bundle exec rage s -b 0.0.0.0 -p 8080 -e production