feat: enhance batch processing by adding rowsPerBatch parameter and improving logging messages
This commit is contained in:
@@ -91,15 +91,15 @@ ORDER BY batch_id`,
|
||||
return batches, nil
|
||||
}
|
||||
|
||||
func batchGeneratorMssql(ctx context.Context, db *sql.DB, tableInfo config.SourceTableInfo) ([]Batch, error) {
|
||||
func batchGeneratorMssql(ctx context.Context, db *sql.DB, tableInfo config.SourceTableInfo, rowsPerBatch int64) ([]Batch, error) {
|
||||
rowsCount, err := estimateTotalRowsMssql(ctx, db, tableInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var batchCount int64 = 1
|
||||
if rowsCount > RowsPerBatch {
|
||||
batchCount = rowsCount / RowsPerBatch
|
||||
if rowsCount > rowsPerBatch {
|
||||
batchCount = rowsCount / rowsPerBatch
|
||||
} else {
|
||||
return []Batch{{
|
||||
Id: uuid.New(),
|
||||
|
||||
Reference in New Issue
Block a user