five-bells-shared
Advanced tools
Comparing version 12.2.3 to 12.2.4
@@ -55,4 +55,12 @@ 'use strict' | ||
const retries = notification.retry_count = (notification.retry_count || 0) + 1 | ||
const delay = Math.min(120, Math.pow(2, retries)) | ||
notification.retry_at = new Date(Date.now() + 1000 * delay) | ||
// Exponential backoff | ||
const delay = Math.pow(2, retries) | ||
// If delay becomes really long (over 1 week), give up. | ||
if (delay >= 60 * 60 * 24 * 7) { | ||
this.log.debug('Give up on notification ' + notification.id) | ||
return notification.destroy() | ||
} | ||
// Add random jitter | ||
notification.retry_at = new Date(Date.now() + Math.round(1000 * delay * (0.8 + Math.random() * 0.4))) | ||
this.log.debug('Notification ' + notification.id + ' new retry_count: ' + notification.retry_count + ', new retry_at: ' + notification.retry_at) | ||
return notification.save() | ||
@@ -59,0 +67,0 @@ } |
{ | ||
"name": "five-bells-shared", | ||
"version": "12.2.3", | ||
"version": "12.2.4", | ||
"description": "Shared components for Five Bells projects.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -81,3 +81,3 @@ { | ||
"e": "NjU1Mzc", | ||
"n": "Njc1NTkwOTcxMTE2NTEwMTIyODY4MzE0NjkwMzkxODI3NTAyMjQ4MzA1NzQ3NzA0NTkxNDg3MzA4MzI4MzQ3ODEzODgyNTgwMTIzMDU1NzE4OTM1MjAyMTY2Njk0OTIwODcxMDkzMzcwNjA2MDc5NTU3Mzg2ODg1MjI3MTY0MTE2NTkwMDYxNTkzMDU0NTQyMDgyMzU0Nzc5NjczMzExODExMzMwNzkwNjI0NTMxNjIxMjg2OTg0MTE3NDgwNzM3MzUwNzUwNjM4Mzg0MjYzNDMwMjczNDQ0OTIwNDgyODY5MDc2MTgzNDEwOTc1NTU2NDM4MzYxNTg4MTIyNzIxNzU0NzU2ODcwNDAyMTI3OTcxNzIxMTc2MjkxMTE2MzEwNzIxMzEyOTExMTgwNTMyNDE5ODE4NzM0NjYwNTE3MDc0MDIxNDE4Nzc3Mjc5NjcwNDkyNjc1NDA5NzU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@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4217
1772443