all repos — searchix @ 12a29a55fe895a964d8d317857ee7fb87d4071f1

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

fix: always re-index if storage is (re-)created

Alan Pearce
commit

12a29a55fe895a964d8d317857ee7fb87d4071f1

parent

15a5b3210a073c83dbd1ace8969df83c53dac755

1 file changed, 4 insertions(+), 4 deletions(-)

changed files
M internal/index/search_test.gointernal/index/search_test.go
@@ -38,7 +38,7 @@ t.Fatal(err)
} defer store.Close() - read, _, exists, err := index.OpenOrCreate(&index.Options{ + read, _, err := index.OpenOrCreate(&index.Options{ Logger: log.Named("index"), Root: root, BatchSize: cfg.Importer.BatchSize,
@@ -51,7 +51,7 @@ if err != nil {
t.Fatal(err) } defer read.Close() - if !exists { + if !read.Exists() { t.Fatal("expected index to exist") }
@@ -125,7 +125,7 @@ t.Fatal(err)
} defer store.Close() - read, _, exists, err := index.OpenOrCreate(&index.Options{ + read, _, err := index.OpenOrCreate(&index.Options{ Force: false, LowMemory: false, Logger: log.Named("index"),
@@ -138,7 +138,7 @@ if err != nil {
t.Fatal(err) } defer read.Close() - if !exists { + if !read.Exists() { t.Fatal("expected index to exist") }