Fix some progress counts sort of

This commit is contained in:
2025-02-10 15:50:15 -05:00
parent 90379386d6
commit a9bccd4d01
3 changed files with 24 additions and 25 deletions

View File

@@ -48,7 +48,7 @@ async function calculateSalesForecasts(startTime, totalProducts, processedCount
elapsed: formatElapsedTime(startTime),
remaining: null,
rate: calculateRate(startTime, processedCount),
percentage: ((processedCount / totalProductsToUpdate) * 100).toFixed(1),
percentage: ((processedCount / totalProducts) * 100).toFixed(1),
timing: {
start_time: new Date(startTime).toISOString(),
end_time: new Date().toISOString(),
@@ -261,12 +261,12 @@ async function calculateSalesForecasts(startTime, totalProducts, processedCount
outputProgress({
status: 'running',
operation: 'Processing sales forecast batch',
current: processedCount,
current: processedCount + myProcessedProducts,
total: totalProducts,
elapsed: formatElapsedTime(startTime),
remaining: estimateRemaining(startTime, processedCount, totalProducts),
rate: calculateRate(startTime, processedCount),
percentage: ((processedCount / totalProductsToUpdate) * 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(),