FEATURE: Trigger an event after a backup restore

This commit is contained in:
Gerhard Schlager 2019-02-18 11:48:03 +01:00
parent 50f833def0
commit 99ad61afb7
1 changed files with 7 additions and 0 deletions

View File

@ -81,6 +81,8 @@ module BackupRestore
clear_theme_cache
extract_uploads
after_restore_hook
rescue SystemExit
log "Restore process was cancelled!"
rollback
@ -531,6 +533,11 @@ module BackupRestore
FileUtils.mkdir_p(directory)
end
def after_restore_hook
log "Executing the after_restore_hook..."
DiscourseEvent.trigger(:restore_complete)
end
def log(message, ex = nil)
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
puts(message)