This commit is contained in:
hackerESQ
2025-04-12 20:22:43 -05:00
parent 20c2cb37cc
commit 69e4d0fb3a
+4 -2
View File
@@ -162,6 +162,7 @@ class CurrencyRate extends Model
$updates = []; $updates = [];
foreach ($period as $date) { foreach ($period as $date) {
try {
$lookupDate = self::getNearestPastDate($date, $rates); $lookupDate = self::getNearestPastDate($date, $rates);
if (is_null($lookupDate)) { if (is_null($lookupDate)) {
@@ -180,6 +181,9 @@ class CurrencyRate extends Model
'created_at' => now()->toDateTimeString(), 'created_at' => now()->toDateTimeString(),
]; ];
} }
} catch (\Throwable $e) {
dump($e->getMessage());
}
} }
dump('inserting'); dump('inserting');
@@ -216,8 +220,6 @@ class CurrencyRate extends Model
// try the day before then // try the day before then
$date = Carbon::parse($date)->subDay(); $date = Carbon::parse($date)->subDay();
dump($date->toDateString());
// prevent runaway infinite loops // prevent runaway infinite loops
if ($date->lessThan($date->copy()->subWeek())) { if ($date->lessThan($date->copy()->subWeek())) {