From 1329bc05d41ff6e82c5426c3dc9b4a3d6966ca81 Mon Sep 17 00:00:00 2001 From: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com> Date: Thu, 27 Oct 2022 15:41:18 +0200 Subject: [PATCH] Log initial sync complete (#86) Tested manually Screenshot 2022-10-27 at 2 21 52 PM --- cmd/sync/watchdog.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/sync/watchdog.go b/cmd/sync/watchdog.go index 13364ae9..deb7dfc3 100644 --- a/cmd/sync/watchdog.go +++ b/cmd/sync/watchdog.go @@ -134,6 +134,7 @@ func (w *watchdog) main(ctx context.Context, applyDiff func(diff) error, remoteP } } prj := project.Get(ctx) + var onlyOnceInitLog sync.Once for { select { case <-ctx.Done(): @@ -147,6 +148,9 @@ func (w *watchdog) main(ctx context.Context, applyDiff func(diff) error, remoteP } change := snapshot.diff(all) if change.IsEmpty() { + onlyOnceInitLog.Do(func() { + log.Printf("[INFO] Initial Sync Complete") + }) continue } log.Printf("[INFO] Action: %v", change) @@ -163,6 +167,9 @@ func (w *watchdog) main(ctx context.Context, applyDiff func(diff) error, remoteP return } } + onlyOnceInitLog.Do(func() { + log.Printf("[INFO] Initial Sync Complete") + }) } } }