Clean up from simplifying
This commit is contained in:
@@ -474,18 +474,6 @@ async function importPurchaseOrders(prodConnection, localConnection, incremental
|
||||
recordsAdded += inserts;
|
||||
recordsUpdated += Math.floor(updates); // Ensure we never have fractional updates
|
||||
processed += batchProcessed;
|
||||
|
||||
// Mark affected products for recalculation
|
||||
const affectedPids = [...new Set(productBatch.map(p => p.pid))];
|
||||
if (affectedPids.length > 0) {
|
||||
await localConnection.query(`
|
||||
INSERT INTO product_metric_status (pid, needs_recalculation)
|
||||
VALUES ${affectedPids.map(() => '(?, TRUE)').join(',')}
|
||||
ON DUPLICATE KEY UPDATE
|
||||
needs_recalculation = TRUE,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
`, affectedPids);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle updates - now we know these actually have changes
|
||||
@@ -511,18 +499,6 @@ async function importPurchaseOrders(prodConnection, localConnection, incremental
|
||||
|
||||
recordsUpdated += Math.floor(updates); // Ensure we never have fractional updates
|
||||
processed += batchProcessed;
|
||||
|
||||
// Mark affected products for recalculation
|
||||
const affectedPids = [...new Set(productBatch.map(p => p.pid))];
|
||||
if (affectedPids.length > 0) {
|
||||
await localConnection.query(`
|
||||
INSERT INTO product_metric_status (pid, needs_recalculation)
|
||||
VALUES ${affectedPids.map(() => '(?, TRUE)').join(',')}
|
||||
ON DUPLICATE KEY UPDATE
|
||||
needs_recalculation = TRUE,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
`, affectedPids);
|
||||
}
|
||||
}
|
||||
|
||||
// Update progress based on time interval
|
||||
|
||||
Reference in New Issue
Block a user