diff options
author | Alan Pearce | 2024-05-09 18:18:59 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-09 19:27:57 +0200 |
commit | fbc4c583a4e2759d6b8cdbb98de2c769918ddac8 (patch) | |
tree | 2b5bd7317e426746781071f771f5ad7979988503 /import | |
parent | 8d5dfd90332facb2613b927cf32472915f87359d (diff) | |
download | searchix-fbc4c583a4e2759d6b8cdbb98de2c769918ddac8.tar.lz searchix-fbc4c583a4e2759d6b8cdbb98de2c769918ddac8.tar.zst searchix-fbc4c583a4e2759d6b8cdbb98de2c769918ddac8.zip |
docs: embed defaults in app
Diffstat (limited to 'import')
-rw-r--r-- | import/main.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/import/main.go b/import/main.go index de652c5..1e6b87d 100644 --- a/import/main.go +++ b/import/main.go @@ -11,7 +11,6 @@ import ( "searchix/internal/config" "searchix/internal/importer" "searchix/internal/search" - "slices" "strings" "time" ) @@ -27,11 +26,7 @@ func main() { log.Fatal(err) } - enabledSources := slices.DeleteFunc(cfg.Sources, func(s importer.Source) bool { - return !s.Enable - }) - - if len(enabledSources) == 0 { + if len(cfg.Sources) == 0 { slog.Info("No sources enabled") return @@ -47,8 +42,8 @@ func main() { var imp importer.Importer var hadErrors bool - for _, source := range enabledSources { - logger := slog.With("name", source.Name, "importer", source.Type.String()) + for name, source := range cfg.Sources { + logger := slog.With("name", name, "importer", source.Type.String()) logger.Debug("starting importer") switch source.Type { |