fix: not that, but maybe this

This commit is contained in:
Joonas Koivunen
2024-08-08 13:24:58 +00:00
parent 0ba5b4daeb
commit 84da02a6df
2 changed files with 4 additions and 6 deletions

View File

@@ -312,7 +312,9 @@ impl Layer {
.get_or_maybe_download(true, Some(ctx))
.await
.map_err(|err| match err {
DownloadError::DownloadCancelled => GetVectoredError::Cancelled,
DownloadError::TimelineShutdown | DownloadError::DownloadCancelled => {
GetVectoredError::Cancelled
}
other => GetVectoredError::Other(anyhow::anyhow!(other)),
})?;

View File

@@ -742,11 +742,7 @@ pub(crate) enum WaitLsnError {
impl From<CreateImageLayersError> for CompactionError {
fn from(e: CreateImageLayersError) -> Self {
match e {
CreateImageLayersError::Cancelled
| CreateImageLayersError::GetVectoredError(GetVectoredError::Cancelled)
| CreateImageLayersError::PageReconstructError(PageReconstructError::Cancelled) => {
CompactionError::ShuttingDown
}
CreateImageLayersError::Cancelled => CompactionError::ShuttingDown,
CreateImageLayersError::Other(e) => {
CompactionError::Other(e.context("create image layers"))
}