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

Method ensure_session

nodedb/src/control/server/pgwire/session/store.rs:34–37  ·  view source on GitHub ↗

Ensure a session exists for this address.

(&self, addr: SocketAddr)

Source from the content-addressed store, hash-verified

32
33 /// Ensure a session exists for this address.
34 pub fn ensure_session(&self, addr: SocketAddr) {
35 let mut sessions = self.sessions.write().unwrap_or_else(|p| p.into_inner());
36 sessions.entry(addr).or_insert_with(PgSession::new);
37 }
38
39 /// Remove a session (connection closed).
40 pub fn remove(&self, addr: &SocketAddr) {

Calls 2

entryMethod · 0.80
writeMethod · 0.45