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

Function fetch_admin_compaction_runtime_config

crates/frontend/src/api.rs:3568–3595  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3566}
3567
3568pub async fn fetch_admin_compaction_runtime_config() -> Result<CompactionRuntimeConfig, String> {
3569 #[cfg(feature = "mock")]
3570 {
3571 Ok(CompactionRuntimeConfig {
3572 enabled: true,
3573 scan_interval_seconds: 900,
3574 fragment_threshold: 128,
3575 prune_older_than_hours: 1,
3576 worker_count: 2,
3577 })
3578 }
3579
3580 #[cfg(not(feature = "mock"))]
3581 {
3582 let url = format!("{}/admin/compaction-config", admin_base());
3583 let response = api_get(&url)
3584 .send()
3585 .await
3586 .map_err(|e| format!("Network error: {:?}", e))?;
3587 if !response.ok() {
3588 return Err(format!("HTTP error: {}", response.status()));
3589 }
3590 response
3591 .json()
3592 .await
3593 .map_err(|e| format!("Parse error: {:?}", e))
3594 }
3595}
3596
3597pub async fn update_admin_compaction_runtime_config(
3598 config: &CompactionRuntimeConfig,

Callers 1

admin_pageFunction · 0.85

Calls 2

api_getFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected