1 |
- {"ast":null,"code":"/**\n * Class used to define a retry strategy when error happens while loading assets\n */\nexport class RetryStrategy {\n /**\n * Function used to defines an exponential back off strategy\n * @param maxRetries defines the maximum number of retries (3 by default)\n * @param baseInterval defines the interval between retries\n * @returns the strategy function to use\n */\n static ExponentialBackoff(maxRetries = 3, baseInterval = 500) {\n return (url, request, retryIndex) => {\n if (request.status !== 0 || retryIndex >= maxRetries || url.indexOf(\"file:\") !== -1) {\n return -1;\n }\n return Math.pow(2, retryIndex) * baseInterval;\n };\n }\n}","map":{"version":3,"names":["RetryStrategy","ExponentialBackoff","maxRetries","baseInterval","url","request","retryIndex","status","indexOf","Math","pow"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Misc/retryStrategy.js"],"sourcesContent":["/**\n * Class used to define a retry strategy when error happens while loading assets\n */\nexport class RetryStrategy {\n /**\n * Function used to defines an exponential back off strategy\n * @param maxRetries defines the maximum number of retries (3 by default)\n * @param baseInterval defines the interval between retries\n * @returns the strategy function to use\n */\n static ExponentialBackoff(maxRetries = 3, baseInterval = 500) {\n return (url, request, retryIndex) => {\n if (request.status !== 0 || retryIndex >= maxRetries || url.indexOf(\"file:\") !== -1) {\n return -1;\n }\n return Math.pow(2, retryIndex) * baseInterval;\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,aAAa,CAAC;EACvB;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOC,kBAAkBA,CAACC,UAAU,GAAG,CAAC,EAAEC,YAAY,GAAG,GAAG,EAAE;IAC1D,OAAO,CAACC,GAAG,EAAEC,OAAO,EAAEC,UAAU,KAAK;MACjC,IAAID,OAAO,CAACE,MAAM,KAAK,CAAC,IAAID,UAAU,IAAIJ,UAAU,IAAIE,GAAG,CAACI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;QACjF,OAAO,CAAC,CAAC;MACb;MACA,OAAOC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEJ,UAAU,CAAC,GAAGH,YAAY;IACjD,CAAC;EACL;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|