MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / poll

Function poll

Example/e2etest/e2e/globalSetup.ts:130–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128
129 return new Promise<void>((resolve, reject) => {
130 const poll = () => {
131 const req = http.get(url, res => {
132 if (res.statusCode === 200) {
133 resolve();
134 return;
135 }
136 retry();
137 });
138 req.on('error', retry);
139 req.setTimeout(1000, () => {
140 req.destroy();
141 retry();
142 });
143 };
144
145 const retry = () => {
146 if (Date.now() - start > timeoutMs) {

Callers 1

waitForServerFunction · 0.70

Calls 2

onMethod · 0.80
retryFunction · 0.70

Tested by

no test coverage detected