MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / upsert

Method upsert

uncommon_route/session.py:94–100  ·  view source on GitHub ↗
(self, record: _SessionRecord)

Source from the content-addressed store, hash-verified

92 return best
93
94 def upsert(self, record: _SessionRecord) -> None:
95 # Move-to-end on touch (LRU).
96 if record.session_id in self._records:
97 self._records.move_to_end(record.session_id)
98 self._records[record.session_id] = record
99 self._evict_expired(record.last_seen_ts)
100 self._evict_over_capacity()
101
102 def _evict_expired(self, now: float) -> None:
103 cutoff = now - self._ttl

Callers 1

derive_session_id_v2Function · 0.80

Calls 2

_evict_expiredMethod · 0.95
_evict_over_capacityMethod · 0.95

Tested by

no test coverage detected