-
Notifications
You must be signed in to change notification settings - Fork 125
perf: make data size calculation async for disable/uninstall responses #814
Copy link
Copy link
Closed
Description
Context
The _get_service_data_info() helper (added in #812) calls dir_size_gb() synchronously during disable/uninstall API responses. dir_size_gb() does a full recursive rglob("*") scan which could take several seconds on large data directories (e.g., ComfyUI models with tens of GB and thousands of files).
Problem
The disable/uninstall response is delayed by the directory scan. For a 50GB data directory with 10K+ files, this could add 2-5 seconds to what should be a fast operation.
Proposed Solution
Options (pick one):
- Background annotation: Return the disable/uninstall response immediately, fire off an async task to compute
data_info, and make it available via a separateGET /api/extensions/{id}/data-infoendpoint - Cached size: Pre-compute and cache directory sizes periodically (e.g., every 60s), return the cached value in disable/uninstall responses
- Opt-in parameter: Add
?include_data_info=truequery param, skip the scan by default
Priority
Low — affects UX only for services with very large data directories. The current synchronous approach works correctly for all services.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels