Skip to content

Commit ee51ed5

Browse files
committed
notifications: log directly about rolling back changes
1 parent e41ca88 commit ee51ed5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/dist/component/transaction.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use std::fs::File;
1313
use std::path::{Path, PathBuf};
1414

1515
use anyhow::{Context, Result, anyhow};
16+
use tracing::info;
1617

1718
use crate::dist::prefix::InstallPrefix;
1819
use crate::dist::temp;
@@ -172,7 +173,7 @@ impl<'a> Transaction<'a> {
172173
impl Drop for Transaction<'_> {
173174
fn drop(&mut self) {
174175
if !self.committed {
175-
(self.notify_handler)(Notification::RollingBack);
176+
info!("rolling back changes");
176177
for item in self.changes.iter().rev() {
177178
// ok_ntfy!(self.notify_handler,
178179
// Notification::NonFatalError,

src/notifications.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub enum Notification<'a> {
1919
ChecksumValid(&'a str),
2020
FileAlreadyDownloaded,
2121
CachedFileChecksumFailed,
22-
RollingBack,
2322
ExtensionNotInstalled(&'a str),
2423
NonFatalError(&'a anyhow::Error),
2524
MissingInstalledComponent(&'a str),
@@ -98,7 +97,6 @@ impl Notification<'_> {
9897
| RemovingComponent(_, _, _)
9998
| RemovingOldComponent(_, _, _)
10099
| ComponentAlreadyInstalled(_)
101-
| RollingBack
102100
| DownloadingManifest(_)
103101
| SkippingNightlyMissingComponent(_, _, _)
104102
| RetryingDownload(_)
@@ -164,7 +162,6 @@ impl Display for Notification<'_> {
164162
ChecksumValid(_) => write!(f, "checksum passed"),
165163
FileAlreadyDownloaded => write!(f, "reusing previously downloaded file"),
166164
CachedFileChecksumFailed => write!(f, "bad checksum for cached download"),
167-
RollingBack => write!(f, "rolling back changes"),
168165
ExtensionNotInstalled(c) => write!(f, "extension '{c}' was not installed"),
169166
NonFatalError(e) => write!(f, "{e}"),
170167
MissingInstalledComponent(c) => {

0 commit comments

Comments
 (0)