From 991043b2cafcf499421dab1dacc12f4bb2b02739 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Mon, 6 Apr 2020 11:40:13 -0400 Subject: [PATCH] fix: call to got v10 --- src/utils.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/utils.js b/src/utils.js index 601fc5d5..f61939bb 100644 --- a/src/utils.js +++ b/src/utils.js @@ -9,17 +9,14 @@ const debugVerbose = require('debug')('netlify-plugin-cypress:verbose') */ const ping = (url, timeout) => { debug('pinging "%s" for %d ms max', url, timeout) - const start = +new Date() return got(url, { retry: { - retries(retry, error) { - const now = +new Date() - debugVerbose( - `${now - start}ms ${error.method} ${error.host} ${ - error.code - }` - ) - if (now - start > timeout) { + limit: 30, + calculateDelay({attemptCount, retryOptions, error, computedValue}) { + debugVerbose(`attempt ${attemptCount} ${computedValue}ms ${error.message}`) + + if (computedValue > timeout) { + debug('%s timed out', url) console.error('%s timed out', url) return 0 }