MCPcopy
hub / github.com/redis/node-redis / timedGet

Function timedGet

packages/client/lib/sentinel/index.spec.ts:1253–1263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1251 await frame.stopSentinel(primarySentinelPort.toString());
1252
1253 const timedGet = async () => {
1254 const getPromise = sentinel!.get('some-key');
1255 void getPromise.catch(() => undefined); // Promise.race may timeout first.
1256
1257 return Promise.race([
1258 getPromise,
1259 setTimeout(1000).then(() => {
1260 throw new Error('1s Timeout');
1261 })
1262 ]);
1263 };
1264
1265 const pollResults: Array<{ phase: 'outage' | 'recovery'; status: 'success' | 'timeout' | 'error' }> = [];
1266 const pollLoop = async (phase: 'outage' | 'recovery', rounds: number) => {

Callers 1

pollLoopFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected