refactor: remove unnecessary single-element loop in disk usage calc
The 'for pattern in [f"hermes-*{task_id[:8]}*"]' was a loop over a
single-element list — just use a plain variable instead.
This commit is contained in:
parent
6d2481ee5c
commit
8c48bb080f
1 changed files with 9 additions and 10 deletions
|
|
@ -638,12 +638,11 @@ def get_active_environments_info() -> Dict[str, Any]:
|
|||
"workdirs": {},
|
||||
}
|
||||
|
||||
# Calculate total disk usage
|
||||
# Calculate total disk usage (per-task to avoid double-counting)
|
||||
total_size = 0
|
||||
for task_id in _active_environments.keys():
|
||||
# Check sandbox and workdir sizes
|
||||
scratch_dir = _get_scratch_dir()
|
||||
for pattern in [f"hermes-*{task_id[:8]}*"]:
|
||||
pattern = f"hermes-*{task_id[:8]}*"
|
||||
import glob
|
||||
for path in glob.glob(str(scratch_dir / pattern)):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue