This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user