Skip to content

Commit 40120c7

Browse files
committed
fix: delay queued currency rates filling
1 parent cfd5b8a commit 40120c7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/Models/CurrencyRate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,11 @@ public static function timeSeriesRates(string|array|null $currency = null, mixed
134134

135135
if (is_array($currency)) {
136136

137+
$i = 1;
137138
foreach ($currency as $curr) {
138139

139-
dispatch(fn () => self::timeSeriesRates($curr, $start, $end));
140+
dispatch(fn () => self::timeSeriesRates($curr, $start, $end))->delay(now()->addSeconds(30 * $i));
141+
$i++;
140142
}
141143

142144
return [];

0 commit comments

Comments
 (0)