From 40120c70272e29f9cfe36b1313f9b929b0389152 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Fri, 11 Jul 2025 22:38:09 -0500 Subject: [PATCH] fix: delay queued currency rates filling --- app/Models/CurrencyRate.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/CurrencyRate.php b/app/Models/CurrencyRate.php index 9c05df0..2136dac 100644 --- a/app/Models/CurrencyRate.php +++ b/app/Models/CurrencyRate.php @@ -134,9 +134,11 @@ class CurrencyRate extends Model if (is_array($currency)) { + $i = 1; foreach ($currency as $curr) { - dispatch(fn () => self::timeSeriesRates($curr, $start, $end)); + dispatch(fn () => self::timeSeriesRates($curr, $start, $end))->delay(now()->addSeconds(30 * $i)); + $i++; } return [];