From 33acfeae9e4a9295b00000c7e0a5072865156eb5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 20 May 2023 11:06:14 +1000 Subject: [PATCH] Add additiona entropy to Backoff method --- app/Jobs/Mail/NinjaMailerJob.php | 4 +++- app/Jobs/Util/WebhookSingle.php | 4 +++- app/Services/Email/Email.php | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 437cc7233fe9..3b8611bb3f1e 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -72,7 +72,9 @@ class NinjaMailerJob implements ShouldQueue public function backoff() { - return [5, 10, 30, 240]; + // return [5, 10, 30, 240]; + return [rand(5, 10), rand(30, 40), rand(60, 79), rand(160, 400)]; + } public function handle() diff --git a/app/Jobs/Util/WebhookSingle.php b/app/Jobs/Util/WebhookSingle.php index d322738601c0..d840d8544359 100644 --- a/app/Jobs/Util/WebhookSingle.php +++ b/app/Jobs/Util/WebhookSingle.php @@ -63,7 +63,9 @@ class WebhookSingle implements ShouldQueue public function backoff() { - return [15, 35, 65, 185, 3605]; + // return [15, 35, 65, 185, 3605]; + return [rand(10, 15), rand(30, 40), rand(60, 79), rand(160, 200), rand(3000, 5000)]; + } /** diff --git a/app/Services/Email/Email.php b/app/Services/Email/Email.php index ddbfee25fb92..6f0488c2be96 100644 --- a/app/Services/Email/Email.php +++ b/app/Services/Email/Email.php @@ -75,7 +75,8 @@ class Email implements ShouldQueue */ public function backoff() { - return [10, 30, 60, 240]; + // return [10, 30, 60, 240]; + return [rand(5, 10), rand(30, 40), rand(60, 79), rand(160, 400)]; } public function handle()