Files
codeocean/config/initializers/docker.rb
Sebastian Serth 942d87f9ba Prevent creation of the Docker containers if just running a db rake task
Otherwise, the rake task might fail if the database connection could not be established (e.g. when creating a new database).
2018-11-22 19:02:33 +01:00

9 lines
325 B
Ruby

DockerClient.initialize_environment unless Rails.env.test? && `which docker`.blank?
if !Rake.application.top_level_tasks.to_s.include?('db:') &&
ApplicationRecord.connection.tables.present? &&
DockerContainerPool.config[:active]
DockerContainerPool.start_refill_task
at_exit { DockerContainerPool.clean_up }
end