Skip to content

Commit

Permalink
use len on slice
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Sep 30, 2023
1 parent 25d7427 commit 6961482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (p *PostgresCDCSource) consumeStream(
for {
if time.Now().After(nextStandbyMessageDeadline) ||
earlyReturn ||
(records.Records != nil && (len(records.Records) == int(req.MaxBatchSize))) {
(len(records.Records) == int(req.MaxBatchSize)) {
// update the WALWritePosition to be clientXLogPos - 1
// as the clientXLogPos is the last checkpoint id + 1
// and we want to send the last checkpoint id as the last
Expand All @@ -163,7 +163,7 @@ func (p *PostgresCDCSource) consumeStream(
log.Infof("Sent Standby status message. %s", numRowsProcessedMessage)
nextStandbyMessageDeadline = time.Now().Add(standbyMessageTimeout)

if earlyReturn || (records.Records != nil && (len(records.Records) == int(req.MaxBatchSize))) {
if earlyReturn || (len(records.Records) == int(req.MaxBatchSize)) {
return result, nil
}
}
Expand Down

0 comments on commit 6961482

Please sign in to comment.