From 86785d89d7f91c935b426e351f1fe38544476ce3 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Mon, 2 Dec 2019 15:19:35 -0500 Subject: [PATCH] Process logs in parallel --- cmd/common.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/common.go b/cmd/common.go index 5b7aa80..cd75fc8 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -328,9 +328,16 @@ func Main(statePath string, processCallback certspotter.ProcessCallback) int { return 1 } - exitCode := 0 + processLogResults := make(chan int) for i := range logs { - exitCode |= processLog(&logs[i], processCallback) + go func(logInfo *certspotter.LogInfo) { + processLogResults <- processLog(logInfo, processCallback) + }(&logs[i]) + } + + exitCode := 0 + for range logs { + exitCode |= <-processLogResults } if state.IsFirstRun() && exitCode == 0 {