diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-06 22:03:47 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-07-06 22:03:47 +0200 |
| commit | 990f6e2aacbbb6869259390d973fde30fac13501 (patch) | |
| tree | 18d4a7f0add623c8141be64247eae46967e49fff /main.go | |
| parent | 1043b58c164ac48757cdb373967ead2b34aa7388 (diff) | |
| download | sourcewatch-990f6e2aacbbb6869259390d973fde30fac13501.tar.gz sourcewatch-990f6e2aacbbb6869259390d973fde30fac13501.zip | |
Add progress logging for initial sync
- Log start of sync with source directory
- Print progress every 1000 files during sync
- Log completion with stats (files, dirs, skipped, errors) and elapsed time
- Print 'watcher: ready' when monitoring begins
- Exit cleanly on dry-run
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -32,6 +32,13 @@ func main() { log.Fatalf("initial sync failed: %v", err) } + if *dryRun { + log.Println("dry-run complete, exiting") + return + } + + log.Println("watcher: ready, monitoring for changes ...") + ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) defer cancel() |
