@enterprise_search/kleislis
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -32,2 +32,4 @@ "use strict"; | ||
incMetric('activity.attempts'); | ||
if (attempts > 0) | ||
console.log('attempts', attempts, retryPolicy.maximumAttempts, delay); | ||
let result = await fn(...args); | ||
@@ -38,2 +40,3 @@ incMetric('activity.success'); | ||
catch (error) { | ||
console.log('error', error.message, 'attempts', attempts, retryPolicy.maximumAttempts, 'retryPolicy.maximumAttempts', retryPolicy.maximumAttempts, 'delay', delay, 'multiplier', multiplier, 'retryPolicy.maximumInterval', retryPolicy.maximumInterval, 'nonRecoverableErrors', nonRecoverableErrors); | ||
if (nonRecoverableErrors.includes(error.message)) { | ||
@@ -40,0 +43,0 @@ incMetric('activity.non_recoverable_error'); |
@@ -11,3 +11,4 @@ "use strict"; | ||
try { | ||
return fn(...args); | ||
// console.log('executing in throttle', throttle.current, throttle.tokensPer100ms) | ||
return await fn(...args); | ||
} | ||
@@ -20,3 +21,3 @@ catch (e) { | ||
} | ||
throttle.current === (throttle.countOnTooManyErrors || -500); | ||
throttle.current = (throttle.countOnTooManyErrors || -10); | ||
} | ||
@@ -23,0 +24,0 @@ throw e; // hopefully the retry logic will kick in |
{ | ||
"name": "@enterprise_search/kleislis", | ||
"description": "functions that have inputs, returns promises, and non functionals around them", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"main": "dist/index", | ||
@@ -6,0 +6,0 @@ "types": "dist/index", |
56882
1186