Skip to content

Commit

Permalink
experiment: fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal committed Apr 17, 2024
1 parent ce826ca commit ac99c5b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flow/connectors/connelasticsearch/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ func (esc *ElasticsearchConnector) SyncQRepRecords(ctx context.Context, config *
bulkIndexErrors = append(bulkIndexErrors, err)
} else {
bulkIndexErrors = append(bulkIndexErrors,
fmt.Errorf("%s %s %v", res.Error.Type, res.Error.Reason, res.Error.Cause))
fmt.Errorf("type:%s reason:%s caused by:(%v)", res.Error.Type,
res.Error.Reason, res.Error.Cause))
}
},
})
Expand All @@ -191,7 +192,9 @@ func (esc *ElasticsearchConnector) SyncQRepRecords(ctx context.Context, config *
}
bulkIndexerHasShutdown = true
if len(bulkIndexErrors) > 0 {
esc.logger.Error("[es] failed to bulk index records", slog.Any("errors", bulkIndexErrors))
for _, err := range bulkIndexErrors {
esc.logger.Error("[es] failed to index record", slog.Any("err", err))
}
}

err = esc.FinishQRepPartition(ctx, partition, config.FlowJobName, startTime)
Expand Down

0 comments on commit ac99c5b

Please sign in to comment.