Merge branch 'master' of https://github.com/openHPI/codeocean
This commit is contained in:
2
Gemfile
2
Gemfile
@ -19,7 +19,7 @@ gem 'kramdown'
|
||||
gem 'newrelic_rpm'
|
||||
gem 'pg', platform: :ruby
|
||||
gem 'pry'
|
||||
gem 'puma'
|
||||
gem 'puma', '~> 2.15.3'
|
||||
gem 'pundit'
|
||||
gem 'rails', '~> 4.1.2'
|
||||
gem 'rails-i18n', '~> 4.0.0'
|
||||
|
10
Gemfile.lock
10
Gemfile.lock
@ -185,13 +185,11 @@ GEM
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
spoon (~> 0.0)
|
||||
puma (2.11.1)
|
||||
rack (>= 1.1, < 2.0)
|
||||
puma (2.11.1-java)
|
||||
rack (>= 1.1, < 2.0)
|
||||
puma (2.15.3)
|
||||
puma (2.15.3-java)
|
||||
pundit (0.3.0)
|
||||
activesupport (>= 3.0.0)
|
||||
rack (1.5.2)
|
||||
rack (1.5.5)
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.1.10)
|
||||
@ -368,7 +366,7 @@ DEPENDENCIES
|
||||
nyan-cat-formatter
|
||||
pg
|
||||
pry
|
||||
puma
|
||||
puma (~> 2.15.3)
|
||||
pundit
|
||||
rails (~> 4.1.2)
|
||||
rails-i18n (~> 4.0.0)
|
||||
|
@ -33,6 +33,8 @@ module CodeOcean
|
||||
case (RUBY_ENGINE)
|
||||
when 'ruby'
|
||||
# ...
|
||||
#this is enabled in prod for testing
|
||||
config.middleware.use ActiveRecord::ConnectionAdapters::ConnectionManagement
|
||||
when 'jruby'
|
||||
# plattform specific
|
||||
java.lang.Class.for_name('javax.crypto.JceSecurity').get_declared_field('isRestricted').tap{|f| f.accessible = true; f.set nil, false}
|
||||
|
@ -18,8 +18,8 @@ production:
|
||||
active: true
|
||||
refill:
|
||||
async: false
|
||||
batch_size: 32
|
||||
interval: 30
|
||||
batch_size: 8
|
||||
interval: 15
|
||||
timeout: 60
|
||||
workspace_root: <%= Rails.root.join('tmp', 'files', Rails.env) %>
|
||||
ws_host: ws://localhost:4243
|
||||
|
@ -73,7 +73,7 @@ class DockerContainerPool
|
||||
end
|
||||
|
||||
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]
|
||||
Concurrent::Future.execute { refill_for_execution_environment(execution_environment) }
|
||||
else
|
||||
@ -99,7 +99,7 @@ class DockerContainerPool
|
||||
end
|
||||
|
||||
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
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user