refactor: remove unused error channels and enhance job configuration; add max failed batches load parameter
This commit is contained in:
@@ -18,6 +18,7 @@ func (gl *GenericLoader) ProcessBatchWithRetries(
|
||||
retryConfig config.RetryConfig,
|
||||
batch models.Batch,
|
||||
) (int64, error) {
|
||||
retries := 0
|
||||
for {
|
||||
rowsLoaded, err := gl.ProcessBatch(ctx, tableInfo, colNames, batch)
|
||||
if err == nil {
|
||||
@@ -25,7 +26,8 @@ func (gl *GenericLoader) ProcessBatchWithRetries(
|
||||
}
|
||||
|
||||
if btError, ok := errors.AsType[*custom_errors.LoaderError](err); ok {
|
||||
batch.RetryCounter++
|
||||
retries++
|
||||
batch.RetryCounter = retries
|
||||
|
||||
if batch.RetryCounter >= retryConfig.Attempts {
|
||||
return rowsLoaded, &custom_errors.JobError{
|
||||
|
||||
Reference in New Issue
Block a user