From a066d2bc4b02c5b24dfc01dae9d50e32f3ed6c0e Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Mon, 13 Nov 2023 11:45:50 +1100 Subject: syz-ci: don't try to create a JobManager when no dashboard specified Instantiating the JobManager will fail if you don't specify a dashboard address, which is an optional field in the syz-ci config. There's no point having a JobManager without a dashboard, so just skip this completely when there's no dashboard. Signed-off-by: Andrew Donnellan --- syz-ci/syz-ci.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go index 4ee611852..fd1f2a7bb 100644 --- a/syz-ci/syz-ci.go +++ b/syz-ci/syz-ci.go @@ -321,13 +321,16 @@ func main() { }() } } - jm, err := newJobManager(cfg, managers, shutdownPending) - if err != nil { - log.Fatalf("failed to create dashapi connection %v", err) - } + ctxJobs, stopJobs := context.WithCancel(ctx) wgJobs := sync.WaitGroup{} - jm.startLoop(ctxJobs, &wgJobs) + if cfg.DashboardAddr != "" { + jm, err := newJobManager(cfg, managers, shutdownPending) + if err != nil { + log.Fatalf("failed to create dashapi connection %v", err) + } + jm.startLoop(ctxJobs, &wgJobs) + } // For testing. Racy. Use with care. http.HandleFunc("/upload_cover", func(w http.ResponseWriter, r *http.Request) { -- cgit mrf-deployment