fix: multi currency seeders

This commit is contained in:
hackerESQ
2025-05-15 20:05:14 -05:00
parent 26370c03c4
commit 689aa4d50b
6 changed files with 66 additions and 225 deletions
+6 -4
View File
@@ -54,8 +54,7 @@ class MarketDataSeeder extends Seeder
$rowCount++;
if ($rowCount % $chunkSize == 0) {
DB::table('market_data')->upsert($this->rows, ['symbol'], ['name', 'currency', 'meta_data']);
$this->rows = [];
$this->bulkInsert($this->rows);
}
}
}
@@ -77,11 +76,14 @@ class MarketDataSeeder extends Seeder
}
}
public function bulkInsert(array $rows)
public function bulkInsert($rows)
{
try {
DB::table('market_data')->insertOrIgnore($rows);
dispatch(
fn () => DB::table('market_data')->upsert($rows, ['symbol'], ['name', 'currency', 'meta_data'])
);
$this->rows = [];
} catch (\Throwable $e) {