all repos — searchix @ 21e9e778cc6be3c8717cd4286bedd17f2b22282a

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

feat: add offline flag to reindex (mostly for dev)

Alan Pearce
commit

21e9e778cc6be3c8717cd4286bedd17f2b22282a

parent

11a0ae77d2e66bcdd0a65c71a160dcc5d9d64e56

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

changed files
M cmd/searchix-web/main.gocmd/searchix-web/main.go
@@ -34,7 +34,8 @@ )
generateErrorPage = flag.Bool("generate-error-page", false, "generate error page and exit") dev = flag.Bool("dev", false, "enable live reloading and nicer logging") replace = flag.Bool("replace", false, "replace existing index and exit") - fetch = flag.Bool("fetch", false, "fetch data and exit") + prefetch = flag.Bool("fetch", false, "pre-fetch data and exit") + offline = flag.Bool("offline", false, "run in offline mode") version = flag.Bool("version", false, "print version information") cpuprofile = flag.String("cpuprofile", "", "enable CPU profiling and save to `file`") )
@@ -139,18 +140,19 @@ LowMemory: cfg.Importer.LowMemory,
Logger: logger.Named("importer"), Manpages: mdb, Root: root, + Offline: *offline, }) if err != nil { logger.Fatal("Failed to create importer", "error", err) } - if !exists || *replace || *fetch { - err := imp.Start(ctx, true, *fetch, nil) + if !exists || *replace || *prefetch { + err := imp.Start(ctx, true, *prefetch, nil) if err != nil { logger.Fatal("Failed to start importer", "error", err) } - if *replace || *fetch { + if *replace || *prefetch { return } }