aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorBernhard Guillon <Bernhard.Guillon@begu.org>2026-07-06 22:03:47 +0200
committerBernhard Guillon <Bernhard.Guillon@begu.org>2026-07-06 22:03:47 +0200
commit990f6e2aacbbb6869259390d973fde30fac13501 (patch)
tree18d4a7f0add623c8141be64247eae46967e49fff /main.go
parent1043b58c164ac48757cdb373967ead2b34aa7388 (diff)
downloadsourcewatch-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.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.go b/main.go
index 24135f5..077aec2 100644
--- a/main.go
+++ b/main.go
@@ -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()