Fix some progress counts sort of
This commit is contained in:
@@ -40,7 +40,7 @@ async function calculateProductMetrics(startTime, totalProducts, processedCount
|
||||
const SKIP_PRODUCT_TIME_AGGREGATES = 0;
|
||||
|
||||
if (isCancelled) {
|
||||
outputProgress({
|
||||
global.outputProgress({
|
||||
status: 'cancelled',
|
||||
operation: 'Product metrics calculation cancelled',
|
||||
current: processedCount,
|
||||
@@ -276,18 +276,17 @@ async function calculateProductMetrics(startTime, totalProducts, processedCount
|
||||
]);
|
||||
|
||||
lastPid = batch[batch.length - 1].pid;
|
||||
processedCount += batch.length;
|
||||
myProcessedProducts += batch.length; // Increment the *module's* count
|
||||
|
||||
outputProgress({
|
||||
status: 'running',
|
||||
operation: 'Processing base metrics batch',
|
||||
current: processedCount,
|
||||
current: processedCount + myProcessedProducts, // Show cumulative progress
|
||||
total: totalProducts,
|
||||
elapsed: formatElapsedTime(startTime),
|
||||
remaining: estimateRemaining(startTime, processedCount, totalProducts),
|
||||
rate: calculateRate(startTime, processedCount),
|
||||
percentage: ((processedCount / totalProducts) * 100).toFixed(1),
|
||||
remaining: estimateRemaining(startTime, processedCount + myProcessedProducts, totalProducts),
|
||||
rate: calculateRate(startTime, processedCount + myProcessedProducts),
|
||||
percentage: (((processedCount + myProcessedProducts) / totalProducts) * 100).toFixed(1),
|
||||
timing: {
|
||||
start_time: new Date(startTime).toISOString(),
|
||||
end_time: new Date().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user