mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Make sure we track restore/backlog success logs as well.
This commit is contained in:
@@ -260,9 +260,9 @@ module BackupRestore
|
||||
def notify_user
|
||||
log "Notifying '#{@user.username}' of the end of the backup..."
|
||||
if @success
|
||||
SystemMessage.create_from_system_user(@user, :backup_succeeded)
|
||||
SystemMessage.create_from_system_user(@user, :backup_succeeded, logs: pretty_logs(@logs))
|
||||
else
|
||||
SystemMessage.create_from_system_user(@user, :backup_failed, logs: @logs.join("\n"))
|
||||
SystemMessage.create_from_system_user(@user, :backup_failed, logs: pretty_logs(@logs))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -378,9 +378,9 @@ module BackupRestore
|
||||
if user = User.find_by(email: @user_info[:email])
|
||||
log "Notifying '#{user.username}' of the end of the restore..."
|
||||
if @success
|
||||
SystemMessage.create_from_system_user(user, :restore_succeeded)
|
||||
SystemMessage.create_from_system_user(user, :restore_succeeded, logs: pretty_logs(@logs))
|
||||
else
|
||||
SystemMessage.create_from_system_user(user, :restore_failed, logs: @logs.join("\n"))
|
||||
SystemMessage.create_from_system_user(user, :restore_failed, logs: pretty_logs(@logs))
|
||||
end
|
||||
else
|
||||
log "Could not send notification to '#{@user_info[:username]}' (#{@user_info[:email]}), because the user does not exists..."
|
||||
|
||||
@@ -10,5 +10,9 @@ module BackupRestore
|
||||
|
||||
output
|
||||
end
|
||||
|
||||
def pretty_logs(logs)
|
||||
logs.join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user