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

Method shutdown

nodedb-test-support/src/cluster_harness/node/lifecycle.rs:325–335  ·  view source on GitHub ↗

Cooperatively shut down every background task this node owns.

(self)

Source from the content-addressed store, hash-verified

323
324 /// Cooperatively shut down every background task this node owns.
325 pub async fn shutdown(self) {
326 self.pg_shutdown_bus.initiate();
327 let _ = self.cluster_shutdown_tx.send(true);
328 let _ = self.poller_shutdown_tx.send(true);
329 let _ = self.core_stop_tx.send(());
330 // Give tokio a chance to drop the task futures before TempDir
331 // is dropped — otherwise redb file locks can linger.
332 for _ in 0..32 {
333 tokio::task::yield_now().await;
334 }
335 }
336}
337
338/// Panic-safe teardown. Without this, a test that panics (e.g. a

Callers

nothing calls this directly

Calls 2

initiateMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected