Clean up from simplifying

This commit is contained in:
2025-02-02 15:41:57 -05:00
parent 7d16500f6f
commit 00c8e1b090
7 changed files with 6 additions and 111 deletions

View File

@@ -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