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:
1 parent
67215a6aaa
commit
f3a91ad915
7 files changed
+51
-5
No files matched your search
@@ -37,8 +37,8 @@ is kept.
|
||||
| `database.file` | string | | Path to the SQLite database file, used by the `migrate` commands. Empty: commands that need the database fail |
|
||||
| `sources.<source>.enabled` | bool | `false` | For every source |
|
||||
| `sources.<source>.interval` | duration | `10m` | For every source; e.g. `30s`, `1h`. Must be greater than 0; turn a source off with `enabled` |
|
||||
| `sources.find_a_tender.api_root` | string | `https://www.find-tender.service.gov.uk/api/1.0` | URL of the Find a Tender API |
|
||||
| `sources.fts_mock.api_root` | string | | URL of the mock FTS server (see `internal/mock`); must be set when the source is enabled |
|
||||
| `sources.find_a_tender.api_root` | string | `https://www.find-tender.service.gov.uk/api/1.0` | URL of the Find a Tender API. Empty: the source fails to start if enabled, and `fetch once` fails |
|
||||
| `sources.fts_mock.api_root` | string | | URL of the mock FTS server (see `internal/mock`). Empty: the source fails to start if enabled |
|
||||
| `sources.sleeper.block_shutdown` | bool | `false` | Test source: if true, its sleep ignores shutdown |
|
||||
| `server.host` | string | `127.0.0.1` | Address to listen on; empty: every interface |
|
||||
| `server.port` | int | `9393` | Port to listen on; `0`: any free port |
|
||||
|
||||
Reference in new issue
Block a user