Use ActiveRecord::Base.connection.active? and rescue any exception in connect_to_db?
Use ActiveRecord::Base.connection.active? and rescue any exception in connect_to_db?

This ensures that rake tasks that don't need a DB connection can be run
without one.

axilleas/gitlabhq,LUMC/gitlabhq,ttasanen/gitlabhq,mr-dxdy/gitlabhq,screenpages/gitlabhq,LUMC/gitlabhq,SVArago/gitlabhq,dplarson/gitlabhq,screenpages/gitlabhq,allysonbarros/gitlabhq,allysonbarros/gitlabhq,t-zuehlsdorff/gitlabhq,jrjang/gitlabhq,stoplightio/gitlabhq,dplarson/gitlabhq,shinexiao/gitlabhq,dplarson/gitlabhq,daiyu/gitlab-zh,dplarson/gitlabhq,htve/GitlabForChinese,ttasanen/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,darkrasid/gitlabhq,Soullivaneuh/gitlabhq,mr-dxdy/gitlabhq,jrjang/gitlabhq,SVArago/gitlabhq,openwide-java/gitlabhq,jrjang/gitlab-ce,axilleas/gitlabhq,mr-dxdy/gitlabhq,allysonbarros/gitlabhq,shinexiao/gitlabhq,screenpages/gitlabhq,SVArago/gitlabhq,shinexiao/gitlabhq,openwide-java/gitlabhq,ttasanen/gitlabhq,iiet/iiet-git,htve/GitlabForChinese,stoplightio/gitlabhq,icedwater/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,martijnvermaat/gitlabhq,dwrensha/gitlabhq,mmkassem/gitlabhq,jrjang/gitlab-ce,LUMC/gitlabhq,dwrensha/gitlabhq,jrjang/gitlab-ce,jrjang/gitlabhq,daiyu/gitlab-zh,dreampet/gitlab,darkrasid/gitlabhq,shinexiao/gitlabhq,mmkassem/gitlabhq,SVArago/gitlabhq,dwrensha/gitlabhq,dwrensha/gitlabhq,daiyu/gitlab-zh,htve/GitlabForChinese,icedwater/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,yatish27/gitlabhq,LUMC/gitlabhq,darkrasid/gitlabhq,martijnvermaat/gitlabhq,axilleas/gitlabhq,openwide-java/gitlabhq,mmkassem/gitlabhq,openwide-java/gitlabhq,jrjang/gitlab-ce,t-zuehlsdorff/gitlabhq,jrjang/gitlabhq,darkrasid/gitlabhq,Soullivaneuh/gitlabhq,martijnvermaat/gitlabhq,iiet/iiet-git,larryli/gitlabhq,htve/GitlabForChinese,icedwater/gitlabhq,larryli/gitlabhq,t-zuehlsdorff/gitlabhq,mr-dxdy/gitlabhq,yatish27/gitlabhq,icedwater/gitlabhq,yatish27/gitlabhq,larryli/gitlabhq,iiet/iiet-git,iiet/iiet-git,jirutka/gitlabhq,martijnvermaat/gitlabhq,allysonbarros/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,larryli/gitlabhq,screenpages/gitlabhq,yatish27/gitlabhq,ttasanen/gitlabhq,daiyu/gitlab-zh,dreampet/gitlab,Soullivaneuh/gitlabhq,mmkassem/gitlabhq,Soullivaneuh/gitlabhq,t-zuehlsdorff/gitlabhq