Import/calculations improvements
This commit is contained in:
@@ -151,7 +151,10 @@ async function importStockSnapshots(prodConnection, localConnection, incremental
|
||||
|
||||
recordsAdded += batch.length;
|
||||
} catch (err) {
|
||||
// Fail the step: the next incremental starts at MAX(snapshot_date), so a
|
||||
// swallowed batch error would leave a permanent hole that is never revisited.
|
||||
console.error(`Error inserting batch at offset ${i} (date range ending ${currentDate}):`, err.message);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +168,7 @@ async function importStockSnapshots(prodConnection, localConnection, incremental
|
||||
current: processedRows,
|
||||
total: totalRows,
|
||||
elapsed: formatElapsedTime(startTime),
|
||||
rate: calculateRate(processedRows, startTime)
|
||||
rate: calculateRate(startTime, processedRows)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user