fix: delete and only then report evicted

This commit is contained in:
Joonas Koivunen
2023-08-28 13:34:34 +03:00
parent 5ff5c580ad
commit 7b39681caf
+2 -2
View File
@@ -847,8 +847,6 @@ impl LayerInner {
LayerResidenceEventReason::ResidenceChange,
);
drop(self.status.send(Status::Evicted));
match capture_mtime_and_remove(&self.path) {
Ok(local_layer_mtime) => {
let duration = SystemTime::now().duration_since(local_layer_mtime);
@@ -881,6 +879,8 @@ impl LayerInner {
tracing::warn!("failed to evict file from disk: {e:#}");
}
}
drop(self.status.send(Status::Evicted));
}
}