refactor: deduplicate indexing code
1 file changed, 3 insertions(+), 9 deletions(-)
changed files
M cmd/searchix-web/ingest.go → cmd/searchix-web/ingest.go
@@ -82,15 +82,9 @@ } } if !exists || opts.Reindex { - for _, source := range cfg.Importer.Sources { - hadErrors, err := imp.IndexSource(ctx, source) - if err != nil { - return fault.Wrap(err, fmsg.Withf("Failed to import source %s", source.Name)) - } - - if hadErrors { - logger.Warn("Imported source encountered errors", "source", source.Name) - } + err = imp.Index(ctx) + if err != nil { + return fault.Wrap(err, fmsg.With("Failed to index data")) } }