This commit is contained in:
Ralf Teusner
2015-11-23 20:25:02 +01:00
5 changed files with 11 additions and 11 deletions

View File

@ -19,7 +19,7 @@ gem 'kramdown'
gem 'newrelic_rpm' gem 'newrelic_rpm'
gem 'pg', platform: :ruby gem 'pg', platform: :ruby
gem 'pry' gem 'pry'
gem 'puma' gem 'puma', '~> 2.15.3'
gem 'pundit' gem 'pundit'
gem 'rails', '~> 4.1.2' gem 'rails', '~> 4.1.2'
gem 'rails-i18n', '~> 4.0.0' gem 'rails-i18n', '~> 4.0.0'

View File

@ -185,13 +185,11 @@ GEM
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
spoon (~> 0.0) spoon (~> 0.0)
puma (2.11.1) puma (2.15.3)
rack (>= 1.1, < 2.0) puma (2.15.3-java)
puma (2.11.1-java)
rack (>= 1.1, < 2.0)
pundit (0.3.0) pundit (0.3.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
rack (1.5.2) rack (1.5.5)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (4.1.10) rails (4.1.10)
@ -368,7 +366,7 @@ DEPENDENCIES
nyan-cat-formatter nyan-cat-formatter
pg pg
pry pry
puma puma (~> 2.15.3)
pundit pundit
rails (~> 4.1.2) rails (~> 4.1.2)
rails-i18n (~> 4.0.0) rails-i18n (~> 4.0.0)

View File

@ -33,6 +33,8 @@ module CodeOcean
case (RUBY_ENGINE) case (RUBY_ENGINE)
when 'ruby' when 'ruby'
# ... # ...
#this is enabled in prod for testing
config.middleware.use ActiveRecord::ConnectionAdapters::ConnectionManagement
when 'jruby' when 'jruby'
# plattform specific # plattform specific
java.lang.Class.for_name('javax.crypto.JceSecurity').get_declared_field('isRestricted').tap{|f| f.accessible = true; f.set nil, false} java.lang.Class.for_name('javax.crypto.JceSecurity').get_declared_field('isRestricted').tap{|f| f.accessible = true; f.set nil, false}

View File

@ -18,8 +18,8 @@ production:
active: true active: true
refill: refill:
async: false async: false
batch_size: 32 batch_size: 8
interval: 30 interval: 15
timeout: 60 timeout: 60
workspace_root: <%= Rails.root.join('tmp', 'files', Rails.env) %> workspace_root: <%= Rails.root.join('tmp', 'files', Rails.env) %>
ws_host: ws://localhost:4243 ws_host: ws://localhost:4243

View File

@ -73,7 +73,7 @@ class DockerContainerPool
end end
def self.refill def self.refill
ExecutionEnvironment.where('pool_size > 0').each do |execution_environment| ExecutionEnvironment.where('pool_size > 0').order(pool_size: :desc).each do |execution_environment|
if config[:refill][:async] if config[:refill][:async]
Concurrent::Future.execute { refill_for_execution_environment(execution_environment) } Concurrent::Future.execute { refill_for_execution_environment(execution_environment) }
else else
@ -99,7 +99,7 @@ class DockerContainerPool
end end
def self.start_refill_task def self.start_refill_task
@refill_task = Concurrent::TimerTask.new(execution_interval: config[:refill][:interval], run_now: false, timeout_interval: config[:refill][:timeout]) { refill } @refill_task = Concurrent::TimerTask.new(execution_interval: config[:refill][:interval], run_now: true, timeout_interval: config[:refill][:timeout]) { refill }
@refill_task.execute @refill_task.execute
end end
end end