MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get

Method get

app/api/agentops/common/cache.py:92–101  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

90 self.conn.commit()
91
92 def get(self, key: str) -> str | None:
93 cursor = self.conn.execute("SELECT value, expiry FROM cache WHERE key = ?", (key,))
94 row = cursor.fetchone()
95 if row:
96 value, expiry = row
97 if expiry is not None and time.time() > expiry:
98 self.delete(key)
99 return None
100 return value
101 return None
102
103 def setex(self, key: str, expiry: int, value: str) -> None:
104 expiry_time = int(time.time() + expiry)

Callers

nothing calls this directly

Calls 2

deleteMethod · 0.95
fetchoneMethod · 0.80

Tested by

no test coverage detected