auto-update: a rebuild is live until its whole subtree is terminal
rebuild_live checked only MetaSync, which finishes in 0.2 s, so the next 5-min pass queued a second rebuild while the first still held the stop, swap and start. It now covers MetaSync, AgentWindow, Prebuild, StopForUpdate, Swap and RebuildBookkeeping. AgentWindow is also the brace of a pause window, so an open pause skips that agent's pass too; the docs say so and a test pins it.
This commit is contained in:
parent
36515c289d
commit
12e797e7e3
1 changed files with 66 additions and 7 deletions
|
|
@ -188,13 +188,13 @@ impl JobQueue {
|
|||
Ok(named)
|
||||
}
|
||||
|
||||
/// Whether a rebuild of `agent` is queued or running: its `MetaSync` is not
|
||||
/// terminal yet.
|
||||
/// Whether a rebuild of `agent` (or a pause window for it) is queued or
|
||||
/// running: any node matching [`model::NodeKind::is_rebuild_step`] is not
|
||||
/// terminal yet. The tail `Reconcile` is outside that set.
|
||||
#[must_use]
|
||||
pub fn rebuild_live(&self, agent: &str) -> bool {
|
||||
self.lock().graph().nodes().any(|n| {
|
||||
!n.state.is_terminal()
|
||||
&& matches!(&n.payload, model::NodeKind::MetaSync { agent: a } if a == agent)
|
||||
!n.state.is_terminal() && n.payload.is_rebuild_step() && n.payload.agent() == agent
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue