fix(#1190): consistent param order in set_resource_limits, drop stale blank line
This commit is contained in:
parent
d1fbb4aef8
commit
69a48f086c
1 changed files with 4 additions and 5 deletions
|
|
@ -50,7 +50,6 @@ const GIT_EMAIL: &str = "c0re@hyperhive.local";
|
||||||
const WEB_PORT_BASE: u16 = 8100;
|
const WEB_PORT_BASE: u16 = 8100;
|
||||||
const WEB_PORT_RANGE: u16 = 900;
|
const WEB_PORT_RANGE: u16 = 900;
|
||||||
|
|
||||||
|
|
||||||
/// FNV-1a hash of a string — shared by `agent_web_port` and
|
/// FNV-1a hash of a string — shared by `agent_web_port` and
|
||||||
/// `agent_network_ip` so the derivation rule is identical.
|
/// `agent_network_ip` so the derivation rule is identical.
|
||||||
fn fnv1a(s: &str) -> u32 {
|
fn fnv1a(s: &str) -> u32 {
|
||||||
|
|
@ -267,7 +266,7 @@ pub async fn spawn(
|
||||||
let container = container_name(name);
|
let container = container_name(name);
|
||||||
priv_run("create", name).await?;
|
priv_run("create", name).await?;
|
||||||
set_nspawn_flags(&container, agent_dir, claude_dir, notes_dir).await?;
|
set_nspawn_flags(&container, agent_dir, claude_dir, notes_dir).await?;
|
||||||
set_resource_limits(&container, memory_max, cpu_quota).await?;
|
set_resource_limits(&container, cpu_quota, memory_max).await?;
|
||||||
systemd_daemon_reload().await?;
|
systemd_daemon_reload().await?;
|
||||||
priv_run("start", name).await
|
priv_run("start", name).await
|
||||||
}
|
}
|
||||||
|
|
@ -460,7 +459,7 @@ pub async fn rebuild_no_meta(
|
||||||
// See `docs/coordinator.md::Container lifecycle`.
|
// See `docs/coordinator.md::Container lifecycle`.
|
||||||
let was_running = is_running(name).await;
|
let was_running = is_running(name).await;
|
||||||
set_nspawn_flags(&container, agent_dir, claude_dir, notes_dir).await?;
|
set_nspawn_flags(&container, agent_dir, claude_dir, notes_dir).await?;
|
||||||
set_resource_limits(&container, memory_max, cpu_quota).await?;
|
set_resource_limits(&container, cpu_quota, memory_max).await?;
|
||||||
systemd_daemon_reload().await?;
|
systemd_daemon_reload().await?;
|
||||||
if was_running {
|
if was_running {
|
||||||
on_step("nix build");
|
on_step("nix build");
|
||||||
|
|
@ -532,7 +531,7 @@ pub async fn rebuild_no_meta(
|
||||||
on_step("nixos-container create");
|
on_step("nixos-container create");
|
||||||
priv_run("create", name).await?;
|
priv_run("create", name).await?;
|
||||||
set_nspawn_flags(&container, agent_dir, claude_dir, notes_dir).await?;
|
set_nspawn_flags(&container, agent_dir, claude_dir, notes_dir).await?;
|
||||||
set_resource_limits(&container, memory_max, cpu_quota).await?;
|
set_resource_limits(&container, cpu_quota, memory_max).await?;
|
||||||
systemd_daemon_reload().await?;
|
systemd_daemon_reload().await?;
|
||||||
on_step("nixos-container start");
|
on_step("nixos-container start");
|
||||||
priv_run("start", name).await
|
priv_run("start", name).await
|
||||||
|
|
@ -1051,7 +1050,7 @@ pub async fn git_update_ref(dir: &Path, refname: &str, target: &str) -> Result<(
|
||||||
/// Write a systemd drop-in for `container@<container>.service` that applies
|
/// Write a systemd drop-in for `container@<container>.service` that applies
|
||||||
/// our default resource caps. Goes under `/run/systemd/system/...` so it's
|
/// our default resource caps. Goes under `/run/systemd/system/...` so it's
|
||||||
/// ephemeral (regenerated on every spawn / rebuild).
|
/// ephemeral (regenerated on every spawn / rebuild).
|
||||||
async fn set_resource_limits(container: &str, memory_max: &str, cpu_quota: &str) -> Result<()> {
|
async fn set_resource_limits(container: &str, cpu_quota: &str, memory_max: &str) -> Result<()> {
|
||||||
crate::priv_client::write_resource_limits(container, memory_max, cpu_quota).await
|
crate::priv_client::write_resource_limits(container, memory_max, cpu_quota).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue