all repos — searchix @ 0dc3ac14c8cd367a415bc14f5e0dd682420e5480

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor: deduplicate indexing code

Alan Pearce
commit

0dc3ac14c8cd367a415bc14f5e0dd682420e5480

parent

d0795bbe26047bd8c270d51dec4a66edc69c2a6a

1 file changed, 3 insertions(+), 9 deletions(-)

changed files
M cmd/searchix-web/ingest.gocmd/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")) } }