Last active
August 29, 2015 14:24
-
-
Save TJM/272c13d98ff6d0fda02a to your computer and use it in GitHub Desktop.
dumper.io initializer
This file contains 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
# Initialize Dumper.IO agent if the secret is present | |
dumper_app_key = Rails.application.secrets.dumper_app_key | |
if dumper_app_key.to_s.eql?('DISABLE') | |
Rails.logger.warn "Database Backup (dumper) is DISABLED due to dumper_app_key" | |
elsif dumper_app_key.nil? | |
Rails.logger.warn("No dumper_app_key specified in secrets.yml, not running Database Backup (dumper)") | |
abort("You must set dumper_app_key in secrets.yml for production. You can set to 'DISABLE' if you don't want it to run.") if Rails.env.production? | |
else | |
Dumper::Agent.start(:app_key => dumper_app_key) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment