style: cargo fmt --all
Apply rustfmt (toolchain 1.96.0) to satisfy the CI Format check. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
@@ -285,7 +285,10 @@ async fn run() -> Result<(), String> {
|
|||||||
// Fleet automation: evaluate metric-threshold rules → drain/undrain/alert.
|
// Fleet automation: evaluate metric-threshold rules → drain/undrain/alert.
|
||||||
cm_api::node_rules::spawn_evaluator(pool.clone(), std::time::Duration::from_secs(20));
|
cm_api::node_rules::spawn_evaluator(pool.clone(), std::time::Duration::from_secs(20));
|
||||||
// Nightly: check upstream for newer dev-tool releases (claude/kimi/ollama).
|
// Nightly: check upstream for newer dev-tool releases (claude/kimi/ollama).
|
||||||
cm_api::tool_versions::spawn_latest_checker(pool.clone(), std::time::Duration::from_secs(86_400));
|
cm_api::tool_versions::spawn_latest_checker(
|
||||||
|
pool.clone(),
|
||||||
|
std::time::Duration::from_secs(86_400),
|
||||||
|
);
|
||||||
|
|
||||||
// Hosted identity (Clerk / OIDC): pin the issuer and load its JWKS.
|
// Hosted identity (Clerk / OIDC): pin the issuer and load its JWKS.
|
||||||
let auth_verifier = match config.auth.mode {
|
let auth_verifier = match config.auth.mode {
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ pub mod fleet;
|
|||||||
mod mcp_door;
|
mod mcp_door;
|
||||||
pub mod node_rules;
|
pub mod node_rules;
|
||||||
pub mod quota;
|
pub mod quota;
|
||||||
pub mod tool_versions;
|
|
||||||
mod recursive_exec;
|
mod recursive_exec;
|
||||||
mod routes;
|
mod routes;
|
||||||
mod runtime_provision;
|
mod runtime_provision;
|
||||||
pub mod swarm;
|
pub mod swarm;
|
||||||
|
pub mod tool_versions;
|
||||||
mod topology_exec;
|
mod topology_exec;
|
||||||
pub mod topology_worker;
|
pub mod topology_worker;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,13 @@ async fn check(pool: &PgPool, client: &reqwest::Client) {
|
|||||||
let _ = node_tools::set_latest(pool, "claude", &v).await;
|
let _ = node_tools::set_latest(pool, "claude", &v).await;
|
||||||
}
|
}
|
||||||
// Kimi CLI — PyPI (it's a uv/python tool).
|
// Kimi CLI — PyPI (it's a uv/python tool).
|
||||||
if let Some(v) = fetch_field(client, "https://pypi.org/pypi/kimi-cli/json", &["info", "version"]).await {
|
if let Some(v) = fetch_field(
|
||||||
|
client,
|
||||||
|
"https://pypi.org/pypi/kimi-cli/json",
|
||||||
|
&["info", "version"],
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
let _ = node_tools::set_latest(pool, "kimi-cli", &v).await;
|
let _ = node_tools::set_latest(pool, "kimi-cli", &v).await;
|
||||||
}
|
}
|
||||||
// Ollama — latest GitHub release tag (strip leading "v").
|
// Ollama — latest GitHub release tag (strip leading "v").
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ use sqlx::{PgPool, Row};
|
|||||||
use crate::DbError;
|
use crate::DbError;
|
||||||
|
|
||||||
/// Replace a node's reported tool versions with `tools` (tool, version).
|
/// Replace a node's reported tool versions with `tools` (tool, version).
|
||||||
pub async fn upsert(pool: &PgPool, node_id: NodeId, tools: &[(String, String)]) -> Result<(), DbError> {
|
pub async fn upsert(
|
||||||
|
pool: &PgPool,
|
||||||
|
node_id: NodeId,
|
||||||
|
tools: &[(String, String)],
|
||||||
|
) -> Result<(), DbError> {
|
||||||
for (tool, version) in tools {
|
for (tool, version) in tools {
|
||||||
sqlx::query(
|
sqlx::query(
|
||||||
"INSERT INTO node_tools (node_id, tool, version, updated_at)
|
"INSERT INTO node_tools (node_id, tool, version, updated_at)
|
||||||
@@ -59,6 +63,11 @@ pub async fn all_latest(pool: &PgPool) -> Result<HashMap<String, String>, DbErro
|
|||||||
.await?;
|
.await?;
|
||||||
Ok(rows
|
Ok(rows
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|r| (r.get::<String, _>("tool"), r.get::<String, _>("latest_version")))
|
.map(|r| {
|
||||||
|
(
|
||||||
|
r.get::<String, _>("tool"),
|
||||||
|
r.get::<String, _>("latest_version"),
|
||||||
|
)
|
||||||
|
})
|
||||||
.collect())
|
.collect())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user