Resolve the setup's folders in one module
CI / tests (pull_request) Successful in 4m39s

This commit is contained in:
2026-12-03 11:19:04 +01:00
parent 45eeef846d
commit 08afc3df85
31 changed files with 115 additions and 35 deletions
+3 -2
View File
@@ -4,6 +4,8 @@ import os
import pathlib
import typing
from loop_state.paths import state_folder
CPUS_PER_SLOT = 4
# Seconds between tries while every slot is held; a slot frees as its command exits.
POLL_SECONDS = 1
@@ -21,8 +23,7 @@ def slot_count(cpus: int | None) -> int:
def slot_folder(env: typing.Mapping[str, str], home: pathlib.Path) -> pathlib.Path:
state = env.get("XDG_STATE_HOME") or str(home / ".local" / "state")
return pathlib.Path(state) / "run-heavy"
return state_folder(env, home) / "run-heavy"
# Locks an open file, as fcntl.flock does.