This commit is contained in:
Aiden McClelland
2021-11-24 12:53:30 -07:00
committed by Aiden McClelland
parent 7a16917971
commit eacc07081c

View File

@@ -129,7 +129,7 @@ pub async fn backup_all(
let revision = assure_backing_up(&mut db).await?;
tokio::task::spawn(async move {
match perform_backup(&ctx, &mut db, backup_guard).await {
Ok(report) => ctx
Ok(report) if report.iter().all(|(_, rep)| rep.error.is_none()) => ctx
.notification_manager
.notify(
&mut db,
@@ -148,6 +148,25 @@ pub async fn backup_all(
)
.await
.expect("failed to send notification"),
Ok(report) => ctx
.notification_manager
.notify(
&mut db,
None,
NotificationLevel::Warning,
"Backup Complete".to_owned(),
"Your backup has completed, but some package(s) failed to backup".to_owned(),
BackupReport {
server: ServerBackupReport {
attempted: true,
error: None,
},
packages: report,
},
None,
)
.await
.expect("failed to send notification"),
Err(e) => {
tracing::error!("Backup Failed: {}", e);
tracing::debug!("{:?}", e);