wip
This commit is contained in:
@@ -162,6 +162,7 @@ class CurrencyRate extends Model
|
||||
$updates = [];
|
||||
foreach ($period as $date) {
|
||||
|
||||
try {
|
||||
$lookupDate = self::getNearestPastDate($date, $rates);
|
||||
|
||||
if (is_null($lookupDate)) {
|
||||
@@ -180,6 +181,9 @@ class CurrencyRate extends Model
|
||||
'created_at' => now()->toDateTimeString(),
|
||||
];
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
dump($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
dump('inserting');
|
||||
@@ -216,8 +220,6 @@ class CurrencyRate extends Model
|
||||
// try the day before then
|
||||
$date = Carbon::parse($date)->subDay();
|
||||
|
||||
dump($date->toDateString());
|
||||
|
||||
// prevent runaway infinite loops
|
||||
if ($date->lessThan($date->copy()->subWeek())) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user