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

Function admin_cleanup_api_behavior

crates/frontend/src/api.rs:3771–3801  ·  view source on GitHub ↗
(
    request: &AdminApiBehaviorCleanupRequest,
)

Source from the content-addressed store, hash-verified

3769}
3770
3771pub async fn admin_cleanup_api_behavior(
3772 request: &AdminApiBehaviorCleanupRequest,
3773) -> Result<AdminApiBehaviorCleanupResponse, String> {
3774 #[cfg(feature = "mock")]
3775 {
3776 Ok(AdminApiBehaviorCleanupResponse {
3777 deleted_events: 0,
3778 before_ms: 0,
3779 retention_days: request.retention_days.unwrap_or(90),
3780 })
3781 }
3782
3783 #[cfg(not(feature = "mock"))]
3784 {
3785 let url = format!("{}/admin/api-behavior/cleanup", admin_base());
3786 let response = api_post(&url)
3787 .header("Content-Type", "application/json")
3788 .json(request)
3789 .map_err(|e| format!("Serialize error: {:?}", e))?
3790 .send()
3791 .await
3792 .map_err(|e| format!("Network error: {:?}", e))?;
3793 if !response.ok() {
3794 return Err(format!("HTTP error: {}", response.status()));
3795 }
3796 response
3797 .json()
3798 .await
3799 .map_err(|e| format!("Parse error: {:?}", e))
3800 }
3801}
3802
3803pub async fn fetch_admin_memory_profiler_overview() -> Result<MemoryProfilerOverview, String> {
3804 #[cfg(feature = "mock")]

Callers 1

admin_pageFunction · 0.50

Calls 2

api_postFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected