MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / transition

Method transition

nodedb-cluster/src/lifecycle_state.rs:165–177  ·  view source on GitHub ↗

Shared implementation: swap the state, log at INFO, push the status string to systemd.

(&self, new: ClusterLifecycleState, human: &str)

Source from the content-addressed store, hash-verified

163 /// Shared implementation: swap the state, log at INFO, push the
164 /// status string to systemd.
165 fn transition(&self, new: ClusterLifecycleState, human: &str) {
166 let prev = {
167 let mut guard = self.inner.write().unwrap_or_else(|p| p.into_inner());
168 std::mem::replace(&mut *guard, new.clone())
169 };
170 info!(
171 prev = prev.label(),
172 new = new.label(),
173 detail = human,
174 "cluster lifecycle transition"
175 );
176 readiness::notify_status(human);
177 }
178}
179
180impl Default for ClusterLifecycleTracker {

Callers 5

to_restartingMethod · 0.80
to_bootstrappingMethod · 0.80
to_joiningMethod · 0.80
to_readyMethod · 0.80
to_failedMethod · 0.80

Calls 3

notify_statusFunction · 0.85
writeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected