all repos — searchix @ 41d40588457290477d87346a133be72be6c621cb

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

refactor: pass indexer to importer only once in options

Alan Pearce
commit

41d40588457290477d87346a133be72be6c621cb

parent

0fb48cf6dd934778584120ebbc9e568c8b80b80e

2 files changed, 2 insertions(+), 3 deletions(-)

jump to
M cmd/searchix-web/main.gocmd/searchix-web/main.go
@@ -107,7 +107,7 @@
return } - err = imp.EnsureSourcesIndexed(ctx, read, write) + err = imp.EnsureSourcesIndexed(ctx, read) if err != nil { logger.Fatal("Failed to setup index", "error", err) }
M internal/importer/main.gointernal/importer/main.go
@@ -244,7 +244,6 @@
func (imp *Importer) EnsureSourcesIndexed( ctx context.Context, read *index.ReadIndex, - write *index.WriteIndex, ) errors.E { cfgEnabledSources := slices.Collect(maps.Keys(imp.config.Importer.Sources)) slices.Sort(cfgEnabledSources)
@@ -275,7 +274,7 @@ }
if len(retiredSources) > 0 { imp.log.Info("removing retired sources", "sources", retiredSources) for _, s := range retiredSources { - err := write.DeleteBySource(s) + err := imp.indexer.DeleteBySource(s) if err != nil { return errors.Wrapf(err, "Failed to remove retired source %s", s) }