Skip to content

Commit

Permalink
Fix iteration (#2193)
Browse files Browse the repository at this point in the history
* fix(maestro): fix iteration to be more performatic and less error prone.

Signed-off-by: Luiz Pegoraro <[email protected]>

* fix(maestro): fix nil reference error

Signed-off-by: Luiz Pegoraro <[email protected]>

---------

Signed-off-by: Luiz Pegoraro <[email protected]>
  • Loading branch information
lpegoraro authored Feb 9, 2023
1 parent 86db196 commit affb48c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maestro/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func (svc *monitorService) monitorSinks(ctx context.Context) {
for _, collector := range runningCollectors {
var sink *sinkspb.SinkRes
for _, sinkRes := range sinksRes.Sinks {
svc.logger.Info("Debug collector name, collector id", zap.String("name", collector.Name), zap.Any("collector", collector))
if strings.Contains(collector.Name, sink.Id) {
svc.logger.Info("Debug collector name, collector id", zap.String("name", collector.Name), zap.String("sinkID", sinkRes.Id))
if strings.Contains(collector.Name, sinkRes.Id) {
sink = sinkRes
break
}
Expand Down

0 comments on commit affb48c

Please sign in to comment.