mirror of
https://github.com/usestrix/strix.git
synced 2026-08-16 09:26:39 +02:00
fix(runtime): also suppress OverflowError for non-finite STRIX_SANDBOX_CPUS
This commit is contained in:
@@ -78,7 +78,7 @@ def _apply_resource_limits(create_kwargs: dict[str, Any]) -> None:
|
|||||||
|
|
||||||
cpus = os.environ.get("STRIX_SANDBOX_CPUS", "").strip()
|
cpus = os.environ.get("STRIX_SANDBOX_CPUS", "").strip()
|
||||||
if cpus:
|
if cpus:
|
||||||
with contextlib.suppress(ValueError):
|
with contextlib.suppress(ValueError, OverflowError):
|
||||||
nano_cpus = int(float(cpus) * 1_000_000_000)
|
nano_cpus = int(float(cpus) * 1_000_000_000)
|
||||||
if nano_cpus > 0:
|
if nano_cpus > 0:
|
||||||
create_kwargs["nano_cpus"] = nano_cpus
|
create_kwargs["nano_cpus"] = nano_cpus
|
||||||
|
|||||||
Reference in New Issue
Block a user