Add release and pool_size methods to DCP

This commit is contained in:
Sebastian Serth
2021-10-24 12:59:55 +02:00
parent 6d1b388e3c
commit ada438b230
3 changed files with 29 additions and 5 deletions

View File

@ -7,8 +7,15 @@ module Admin
end
def docker_data
pool_size = begin
Runner.strategy_class.pool_size
rescue Runner::Error => e
Rails.logger.debug { "Runner error while fetching current pool size: #{e.message}" }
[]
end
ExecutionEnvironment.order(:id).select(:id, :pool_size).map do |execution_environment|
execution_environment.attributes.merge(quantity: DockerContainerPool.quantities[execution_environment.id])
execution_environment.attributes.merge(quantity: pool_size[execution_environment.id])
end
end
end