[ARVADOS] created: 1.3.0-2844-gbb0c95e59

Git user git at public.arvados.org
Wed Aug 5 11:59:30 UTC 2020


        at  bb0c95e59ed5bda44837042e5768732f9bd822a2 (commit)


commit bb0c95e59ed5bda44837042e5768732f9bd822a2
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Wed Aug 5 08:58:40 2020 -0300

    16470: Avoids crashing when running rake db:create. WIP
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/services/api/config/initializers/legacy_jobs_api.rb b/services/api/config/initializers/legacy_jobs_api.rb
index 05258edf5..2abe40566 100644
--- a/services/api/config/initializers/legacy_jobs_api.rb
+++ b/services/api/config/initializers/legacy_jobs_api.rb
@@ -9,7 +9,12 @@
 require 'enable_jobs_api'
 
 Rails.application.configure do
-  if ActiveRecord::Base.connected? and ActiveRecord::Base.connection.tables.include?('jobs')
-    check_enable_legacy_jobs_api
+  begin
+    if ActiveRecord::Base.connection.tables.include?('jobs')
+      check_enable_legacy_jobs_api
+    end
+  rescue ActiveRecord::NoDatabaseError
+    # Since rails 5.2, all initializers are run by rake tasks (like db:create),
+    # see: https://github.com/rails/rails/issues/32870
   end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list