feat(infra): temp IdeA généralisé à tous les agents + purge du store managed-tmp au shutdown d'IdeA — #200 (QA verte)

This commit is contained in:
2026-08-15 00:14:25 +02:00
parent e6f6eb5b1b
commit b5653b24b5
10 changed files with 271 additions and 14 deletions

View File

@ -191,6 +191,32 @@ impl GcManagedTemp {
}
}
/// Output for [`PurgeManagedTemp`].
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PurgeManagedTempOutput {
/// Purge report.
pub report: ManagedTempGcReport,
}
/// Eagerly purges all managed temporary allocations.
pub struct PurgeManagedTemp {
store: Arc<dyn ManagedTempStore>,
}
impl PurgeManagedTemp {
/// Builds the use case.
#[must_use]
pub fn new(store: Arc<dyn ManagedTempStore>) -> Self {
Self { store }
}
/// Executes the purge.
pub async fn execute(&self) -> Result<PurgeManagedTempOutput, AppError> {
let report = self.store.purge_all().await?;
Ok(PurgeManagedTempOutput { report })
}
}
fn now_ms(clock: &Arc<dyn Clock>) -> u64 {
u64::try_from(clock.now_millis()).unwrap_or(0)
}