Last active
December 5, 2017 16:59
-
-
Save michaeldever/24e5aaed918e5be7a89348ccb660a4d0 to your computer and use it in GitHub Desktop.
ActiveRecord Connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def establish_active_record_connection | |
defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection | |
end | |
Daemons.run_proc('rabbit_mq', multiple: false, backtrace: true, log_output: true) do | |
begin | |
establish_active_record_connection | |
rescue StandardError => e | |
puts e.message | |
puts e.backtrace | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment