File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,21 @@ const debugVerbose = require('debug')('netlify-plugin-cypress:verbose')
9
9
*/
10
10
const ping = ( url , timeout ) => {
11
11
debug ( 'pinging "%s" for %d ms max' , url , timeout )
12
+ const start = + new Date ( )
13
+
12
14
return got ( url , {
13
15
retry : {
14
16
limit : 30 ,
15
- calculateDelay ( { attemptCount, retryOptions, error, computedValue} ) {
16
- debugVerbose ( `attempt ${ attemptCount } ${ computedValue } ms ${ error . message } ` )
17
+ calculateDelay ( { attemptCount, retryOptions, error} ) {
18
+ const now = + new Date ( )
19
+ const elapsed = now - start
20
+ debugVerbose ( `attempt ${ attemptCount } ${ elapsed } ms ${ error . message } ` )
17
21
18
- if ( computedValue > timeout ) {
19
- debug ( '%s timed out' , url )
20
- console . error ( '%s timed out' , url )
22
+ if ( elapsed > timeout ) {
23
+ debug ( '%s timed out after %dms, timeout was %dms' ,
24
+ url , elapsed , timeout )
25
+ console . error ( '%s timed out after %dms, timeout was %dms' ,
26
+ url , elapsed , timeout )
21
27
return 0
22
28
}
23
29
return 1000
You can’t perform that action at this time.
0 commit comments