Browse Source

remove unnessesary comments

pull/5858/head
Sven Günther 4 days ago
parent
commit
9e4df2573b
  1. 2
      apps/api/src/services/market-data/market-data.service.ts
  2. 2
      apps/api/src/services/queues/data-gathering/data-gathering.processor.ts
  3. 2
      apps/api/src/services/queues/data-gathering/data-gathering.service.ts

2
apps/api/src/services/market-data/market-data.service.ts

@ -221,7 +221,6 @@ export class MarketDataService {
data: Prisma.MarketDataUpdateInput[]; data: Prisma.MarketDataUpdateInput[];
}): Promise<void> { }): Promise<void> {
await this.prismaService.$transaction(async (prisma) => { await this.prismaService.$transaction(async (prisma) => {
// First, delete all existing market data for this symbol
await prisma.marketData.deleteMany({ await prisma.marketData.deleteMany({
where: { where: {
dataSource, dataSource,
@ -229,7 +228,6 @@ export class MarketDataService {
} }
}); });
// Then, insert all new market data
const upsertPromises = data.map( const upsertPromises = data.map(
({ dataSource, date, marketPrice, state }) => { ({ dataSource, date, marketPrice, state }) => {
return prisma.marketData.create({ return prisma.marketData.create({

2
apps/api/src/services/queues/data-gathering/data-gathering.processor.ts

@ -157,8 +157,6 @@ export class DataGatheringProcessor {
currentDate = addDays(currentDate, 1); currentDate = addDays(currentDate, 1);
} }
// If replaceExistingData is true, use atomic replace to prevent data loss
// on failure. Otherwise, use the normal upsert approach.
if (replaceExistingData) { if (replaceExistingData) {
await this.marketDataService.replaceAllForSymbol({ await this.marketDataService.replaceAllForSymbol({
dataSource, dataSource,

2
apps/api/src/services/queues/data-gathering/data-gathering.service.ts

@ -105,8 +105,6 @@ export class DataGatheringService {
date: date ?? item.date date: date ?? item.date
})); }));
// Add a flag to indicate this should replace all existing data
// The data will be deleted and replaced within a transaction in the processor
await this.gatherSymbols({ await this.gatherSymbols({
dataGatheringItems, dataGatheringItems,
priority: DATA_GATHERING_QUEUE_PRIORITY_HIGH, priority: DATA_GATHERING_QUEUE_PRIORITY_HIGH,

Loading…
Cancel
Save