Skip to content

Commit fb52e0c

Browse files
authored
fix: call to got v10 (#28)
1 parent f6e9e8a commit fb52e0c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/utils.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ const debugVerbose = require('debug')('netlify-plugin-cypress:verbose')
99
*/
1010
const ping = (url, timeout) => {
1111
debug('pinging "%s" for %d ms max', url, timeout)
12-
const start = +new Date()
1312
return got(url, {
1413
retry: {
15-
retries(retry, error) {
16-
const now = +new Date()
17-
debugVerbose(
18-
`${now - start}ms ${error.method} ${error.host} ${
19-
error.code
20-
}`
21-
)
22-
if (now - start > timeout) {
14+
limit: 30,
15+
calculateDelay({attemptCount, retryOptions, error, computedValue}) {
16+
debugVerbose(`attempt ${attemptCount} ${computedValue}ms ${error.message}`)
17+
18+
if (computedValue > timeout) {
19+
debug('%s timed out', url)
2320
console.error('%s timed out', url)
2421
return 0
2522
}

0 commit comments

Comments
 (0)