refactor: deduplicate indexing code
1 file changed, 3 insertions(+), 9 deletions(-)
changed files
M cmd/searchix-web/serve.go → cmd/searchix-web/serve.go
@@ -86,15 +86,9 @@ if err != nil { return fault.Wrap(err, fmsg.With("Failed to start importer")) } - 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")) } }