Invite admins to automatic backups failure topic.

https://meta.discourse.org/t/if-automatic-backup-fails-there-should-be-a-warning/64461
This commit is contained in:
Guo Xiang Tan 2017-06-14 15:00:43 +09:00
parent 2fdf9068eb
commit f6060bfbf6

View File

@ -259,9 +259,15 @@ module BackupRestore
log "Notifying '#{@user.username}' of the end of the backup..."
status = @success ? :backup_succeeded : :backup_failed
SystemMessage.create_from_system_user(@user, status,
post = SystemMessage.create_from_system_user(@user, status,
logs: Discourse::Utils.pretty_logs(@logs)
)
if @user.id == Discourse::SYSTEM_USER_ID
post.topic.invite_group(@user, Group[:admins])
end
post
end
def clean_up