MCPcopy Index your code
hub / github.com/adobe/react-spectrum / checkServer

Function checkServer

scripts/testDocs.js:41–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 return new Promise((resolve, reject) => {
40 const startTime = Date.now();
41 const checkServer = () => {
42 http
43 .get(url, res => {
44 if (res.statusCode === 200) {
45 resolve();
46 } else {
47 retryOrFail();
48 }
49 })
50 .on('error', retryOrFail);
51 };
52
53 const retryOrFail = () => {
54 if (Date.now() - startTime < timeout) {

Callers 1

waitForServerFunction · 0.85

Calls 2

retryOrFailFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected