all repos — searchix @ 84f1c93bbfea63b316665dd3a0bd696ad7bb1856

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

perf: use indexer's batch size for storage export

Alan Pearce
commit

84f1c93bbfea63b316665dd3a0bd696ad7bb1856

parent

bf84c891208a42a2bdd42f21f4190fb965de713a

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

changed files
M internal/importer/importer.gointernal/importer/importer.go
@@ -21,12 +21,21 @@ func (imp *Importer) indexSource(
ctx context.Context, source *config.Source, ) (bool, error) { + writer := imp.options.WriteIndex var exporter func(context.Context) (<-chan nix.Importable, <-chan error) switch source.Importer { case config.Packages: - exporter = storage.MakeSourceExporter[nix.Package](imp.options.Storage, source) + exporter = storage.MakeSourceExporter[nix.Package]( + imp.options.Storage, + source, + writer.GetBatchSize(), + ) case config.Options: - exporter = storage.MakeSourceExporter[nix.Option](imp.options.Storage, source) + exporter = storage.MakeSourceExporter[nix.Option]( + imp.options.Storage, + source, + writer.GetBatchSize(), + ) } return pipe(
@@ -34,7 +43,7 @@ ctx,
imp.options.Logger, exporter, func(ctx context.Context, objects <-chan nix.Importable) <-chan error { - return imp.options.WriteIndex.Import(ctx, objects) + return writer.Import(ctx, objects) }, ) }