Spaces:
Sleeping
Sleeping
pythonic-rag-FastAPIReact / frontend /node_modules /@pmmmwh /react-refresh-webpack-plugin /client /utils /retry.js
Download frontend/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/utils/retry.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/%40pmmmwh/react-refresh-webpack-plugin/client/utils/retry.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/utils/retry.js
-
curl -L -o retry.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/%40pmmmwh/react-refresh-webpack-plugin/client/utils/retry.js
526 Bytes
| function runWithRetry(callback, maxRetries) { | |
| function executeWithRetryAndTimeout(currentCount) { | |
| try { | |
| if (currentCount > maxRetries - 1) { | |
| console.warn('[React Refresh] Failed to set up the socket connection.'); | |
| return; | |
| } | |
| callback(); | |
| } catch (err) { | |
| setTimeout( | |
| function () { | |
| executeWithRetryAndTimeout(currentCount + 1); | |
| }, | |
| Math.pow(10, currentCount) | |
| ); | |
| } | |
| } | |
| executeWithRetryAndTimeout(0); | |
| } | |
| module.exports = runWithRetry; | |