MCPcopy
hub / github.com/logto-io/logto / get

Function get

packages/core/src/caches/index.ts:92–100  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

90 }
91
92 async get(key: string): Promise<Optional<string>> {
93 if (!this.isClientReady) {
94 return;
95 }
96
97 return conditional(
98 await raceWithTimeout('GET', key, this.client?.get(key), redisCacheReadTimeout)
99 );
100 }
101
102 // Unlike `get`/`set`, `delete` is not gated on `isClientReady`: a dropped invalidation could
103 // serve stale data until TTL, so let it queue and flush once the connection recovers. It stays

Calls 2

raceWithTimeoutFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected