mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Trigger an event after a backup restore
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user