Clean up from simplifying
This commit is contained in:
@@ -473,18 +473,6 @@ async function importOrders(prodConnection, localConnection, incrementalUpdate =
|
||||
recordsAdded += inserts;
|
||||
recordsUpdated += updates;
|
||||
importedCount += processedOrderItems.size;
|
||||
|
||||
// Mark affected products for recalculation
|
||||
const affectedPids = [...new Set(validOrders.map(o => o.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 unique orders processed
|
||||
@@ -597,18 +585,6 @@ async function importOrders(prodConnection, localConnection, incrementalUpdate =
|
||||
recordsAdded += inserts;
|
||||
recordsUpdated += updates;
|
||||
importedCount += retryOrderItems.size;
|
||||
|
||||
// Mark affected products for recalculation
|
||||
const affectedPids = [...new Set(validOrders.map(o => o.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);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Warning: Failed to retry skipped orders:', error.message);
|
||||
|
||||
Reference in New Issue
Block a user