mirror of
https://forge.darkest.space/hyperhive/hyperhive.git
synced 2026-12-03 13:31:02 +01:00
swarm-controller: agent permissions and inference take the settings sub-state
This commit is contained in:
parent
8717e68021
commit
4a7df3f804
1 changed files with 222 additions and 85 deletions
|
|
@ -82,9 +82,10 @@ impl FromRef<AppState> for AgentReadersState {
|
|||
}
|
||||
}
|
||||
|
||||
/// What the agent settings handlers (schedules, limits) may reach of
|
||||
/// [`AppState`]: the queue reader, and the wanted-state writer and hive list
|
||||
/// that say which agents are live.
|
||||
/// What the agent settings handlers (schedules, limits, permissions,
|
||||
/// inference) may reach of [`AppState`]: the queue reader, the wanted-state
|
||||
/// writer and hive list that say which agents are live, and what the agents
|
||||
/// reported (login capabilities, inference in use).
|
||||
///
|
||||
/// Derived per request from [`AppState`] (`FromRef`), so each field is a clone
|
||||
/// of the same `Arc` and nothing is held twice.
|
||||
|
|
@ -93,6 +94,8 @@ pub(crate) struct AgentSettingsState {
|
|||
pub(crate) status: Option<Arc<crate::status::StatusReader>>,
|
||||
pub(crate) wanted: Option<Arc<crate::wanted::WantedWriter>>,
|
||||
pub(crate) hives: Arc<Vec<crate::routes::hives::HiveEntry>>,
|
||||
pub(crate) agent_login: Option<Arc<agent_login::Reported>>,
|
||||
pub(crate) reported_inference: Option<Arc<inference::Reported>>,
|
||||
}
|
||||
|
||||
impl FromRef<AppState> for AgentSettingsState {
|
||||
|
|
@ -101,6 +104,8 @@ impl FromRef<AppState> for AgentSettingsState {
|
|||
status: state.status.clone(),
|
||||
wanted: state.wanted.clone(),
|
||||
hives: Arc::clone(&state.hives),
|
||||
agent_login: state.agent_login.clone(),
|
||||
reported_inference: state.reported_inference.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue