mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
Make sure we log failures in ensure
block.
This commit is contained in:
parent
4aa3442824
commit
b981041f6f
1 changed files with 8 additions and 2 deletions
|
@ -52,12 +52,18 @@ module BackupRestore
|
|||
rescue Exception => ex
|
||||
log "EXCEPTION: " + ex.message
|
||||
log ex.backtrace.join("\n")
|
||||
@success = false
|
||||
else
|
||||
@success = true
|
||||
"#{@archive_basename}.tar.gz"
|
||||
ensure
|
||||
notify_user rescue nil
|
||||
remove_old rescue nil
|
||||
begin
|
||||
notify_user
|
||||
remove_old
|
||||
rescue => ex
|
||||
Rails.logger.error("#{ex}\n" + ex.backtrace.join("\n"))
|
||||
end
|
||||
|
||||
clean_up
|
||||
@success ? log("[SUCCESS]") : log("[FAILED]")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue