An empty api_root now fails at start, for an enabled find_a_tender or fts_mock source and for fetch once

An enabled Find a Tender or mock source with no api_root used to start
and then fail on every fetch. Its worker now returns an error naming the
missing key before it starts, which stops Run. "fetch once" checks
sources.find_a_tender.api_root the same way. TestRunMissingAPIRoot covers
both sources, and TestRunLogsSourceErrors sets an api_root so it still
tests the zero interval. The section docs and internal/config/README.md
say what an empty api_root means.
This commit is contained in:
bwilliams committed 2026-10-15 16:27:49 +01:00
1 parent 67215a6aaa
commit f3a91ad915
7 files changed
+51 -5

No files matched your search

+4
View File
@@ -2,6 +2,7 @@ package fetch
import (
"encoding/json"
"errors"
"fmt"
"log/slog"
"slices"
@@ -73,6 +74,9 @@ func commandOnce(opts *cli.Options) *cobra.Command {
return sinceErr
}
if conf.Sources.FindATender.APIRoot == "" {
return errors.New("sources.find_a_tender.api_root is not set")
}
findATender := findatender.New(conf, conf.Sources.FindATender.APIRoot)
defer findATender.Shutdown()