MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / close_session

Method close_session

bindings/python/graphlite/graphlite.py:312–338  ·  view source on GitHub ↗

Close a session Args: session_id: Session ID to close Raises: GraphLiteError: If session close fails

(self, session_id: str)

Source from the content-addressed store, hash-verified

310 self.query(session_id, statement)
311
312 def close_session(self, session_id: str) -> None:
313 """
314 Close a session
315
316 Args:
317 session_id: Session ID to close
318
319 Raises:
320 GraphLiteError: If session close fails
321 """
322 if not self._db:
323 return
324
325 error = ctypes.c_int(0)
326 result = _lib.graphlite_close_session(
327 self._db,
328 session_id.encode('utf-8'),
329 ctypes.byref(error)
330 )
331
332 if result != 0:
333 raise GraphLiteError(
334 ErrorCode(error.value),
335 f"Failed to close session {session_id}"
336 )
337
338 self._sessions.discard(session_id)
339
340 def close(self) -> None:
341 """Close the database and all sessions"""

Callers 4

closeMethod · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.45

Calls 3

GraphLiteErrorClass · 0.70
ErrorCodeClass · 0.70

Tested by

no test coverage detected