Skip to content

Commit d646312

Browse files
committed
refactor: remove nested loop and initialize metrics with worker
1 parent ab49770 commit d646312

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

internal/certificatetransparency/ct-watcher.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ func (w *Watcher) addNewlyAvailableLogs(logList loglist3.LogList) {
148148
ctIndex: lastCTIndex,
149149
}
150150
w.workers = append(w.workers, &ctWorker)
151+
metrics.Init(operator.Name, transparencyLog.URL)
151152

152153
// Start a goroutine for each worker
153154
go func() {
@@ -486,14 +487,6 @@ func getAllLogs() (loglist3.LogList, error) {
486487
}
487488
}
488489

489-
// Add new ct logs to metrics
490-
for _, operator := range allLogs.Operators {
491-
for _, ctlog := range operator.Logs {
492-
url := normalizeCtlogURL(ctlog.URL)
493-
metrics.Init(operator.Name, url)
494-
}
495-
}
496-
497490
return *allLogs, nil
498491
}
499492

0 commit comments

Comments
 (0)