Skip to content

Commit

Permalink
Log initial sync complete (#86)
Browse files Browse the repository at this point in the history
Tested manually
<img width="930" alt="Screenshot 2022-10-27 at 2 21 52 PM"
src="https://user-images.githubusercontent.com/88374338/198282897-ad0c3d62-be92-4ec4-a0e1-4df2a7eab2b9.png">
  • Loading branch information
shreyas-goenka authored Oct 27, 2022
1 parent 18dae73 commit 1329bc0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/sync/watchdog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)
Expand All @@ -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")
})
}
}
}

0 comments on commit 1329bc0

Please sign in to comment.