MCPcopy Create free account
hub / github.com/acking-you/static_flow / prune_table_versions

Function prune_table_versions

crates/store/src/optimize.rs:163–178  ·  view source on GitHub ↗
(
    table: &Table,
    older_than_hours: i64,
    delete_unverified: bool,
    error_if_tagged_old_versions: bool,
)

Source from the content-addressed store, hash-verified

161}
162
163pub async fn prune_table_versions(
164 table: &Table,
165 older_than_hours: i64,
166 delete_unverified: bool,
167 error_if_tagged_old_versions: bool,
168) -> Result<(), String> {
169 table
170 .optimize(OptimizeAction::Prune {
171 older_than: Some(chrono::Duration::hours(older_than_hours)),
172 delete_unverified: Some(delete_unverified),
173 error_if_tagged_old_versions: Some(error_if_tagged_old_versions),
174 })
175 .await
176 .map_err(|err| format!("prune failed: {err:#}"))?;
177 Ok(())
178}
179
180/// Scan tables, compact those exceeding the fragment threshold, and prune old
181/// versions on every enabled maintenance pass.

Calls

no outgoing calls

Tested by

no test coverage detected