mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
Replace Promise.all with createMany to handle duplicate dates in the data array when atomically replacing market data. The previous implementation used multiple parallel create() operations which caused a P2002 unique constraint violation when the data array contained duplicate dates (e.g., when market prices are forward-filled for non-trading days). Changes: - Replace Promise.all of individual create() operations with createMany() - Add skipDuplicates: true to silently handle duplicate records - Add data.length check to avoid empty createMany call This maintains the atomic transaction behavior while efficiently handling batch inserts with potential duplicates.pull/5858/head
1 changed files with 12 additions and 15 deletions
Loading…
Reference in new issue