From 1dea35b9bcb3d37d61e554a99488626da9795331 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Fri, 23 Jun 2023 21:25:37 +0200 Subject: feat: Remove unecessary param from repo --- pkg/worker/file_scanner.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg/worker/file_scanner.go') diff --git a/pkg/worker/file_scanner.go b/pkg/worker/file_scanner.go index 321fbca..0dc2eb2 100644 --- a/pkg/worker/file_scanner.go +++ b/pkg/worker/file_scanner.go @@ -33,6 +33,12 @@ func (f *FileScanner) Query(ctx context.Context) (<-chan string, error) { go func() { defer close(c) _ = filepath.Walk(f.root, func(path string, info fs.FileInfo, err error) error { + select { + case <-ctx.Done(): + return filepath.SkipAll + default: + } + if info.IsDir() && filepath.Base(info.Name())[0] == '.' { return filepath.SkipDir } -- cgit v1.2.3