Skip to content

Commit ba77e36

Browse files
committed
substitue break with continue to avoid breaking
the loop without trimming all elements in `allDistinctMetricTables` - this is more informative in the logs also.
1 parent 65f3da7 commit ba77e36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/sinks/postgres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ func (pgw *PostgresWriter) MaintainUniqueSources() {
558558
rows, _ := pgw.sinkDb.Query(pgw.ctx, fmt.Sprintf(sqlDistinct, tableName, tableName))
559559
ret, err := pgx.CollectRows(rows, pgx.RowTo[string])
560560
if err != nil {
561-
logger.Errorf("Could not refresh Postgres all_distinct_dbname_metrics listing table for '%s': %s", metricName, err)
562-
break
561+
logger.Errorf("Could not refresh Postgres all_distinct_dbname_metrics listing table for metric '%s': %s", metricName, err)
562+
continue
563563
}
564564
for _, drDbname := range ret {
565565
foundDbnamesMap[drDbname] = true // "set" behaviour, don't want duplicates

0 commit comments

Comments
 (0)