Class: NxtHerokuDatabaseBackup::Manager

Inherits:
Object
  • Object
show all
Includes:
NxtInit
Defined in:
lib/nxt_heroku_database_backup/manager.rb

Instance Method Summary collapse

Instance Method Details

#backup_latest_dumpObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/nxt_heroku_database_backup/manager.rb', line 18

def backup_latest_dump
  error = nil
  download_backup
  encrypt_backup
  upload_backup
  execute_success_callback
rescue StandardError => err
  error = err
ensure
  [backup_tmp_path, encrypted_backup_tmp_path].each do |path|
    File.delete(path) if File.exist?(path)
  end

  raise error if error
end