Don't try to upsert zero records
parent
542be03088
commit
bae23a62d0
|
@ -338,7 +338,7 @@ func (c *Consumer) processMessage(ctx context.Context, typ string, r io.Reader,
|
||||||
if len(recs) == 0 && expectRecords {
|
if len(recs) == 0 && expectRecords {
|
||||||
log.Debug().Int64("seq", payload.Seq).Str("pds", c.remote.Host).Msgf("len(recs) == 0")
|
log.Debug().Int64("seq", payload.Seq).Str("pds", c.remote.Host).Msgf("len(recs) == 0")
|
||||||
}
|
}
|
||||||
if len(recs) > 0 || expectRecords {
|
if len(recs) > 0 {
|
||||||
err = c.db.Model(&repo.Record{}).
|
err = c.db.Model(&repo.Record{}).
|
||||||
Clauses(clause.OnConflict{
|
Clauses(clause.OnConflict{
|
||||||
Where: clause.Where{Exprs: []clause.Expression{clause.Or(
|
Where: clause.Where{Exprs: []clause.Expression{clause.Or(
|
||||||
|
|
Loading…
Reference in New Issue