Skip to content

Commit 1329bc0

Browse files
Log initial sync complete (#86)
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">
1 parent 18dae73 commit 1329bc0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/sync/watchdog.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ func (w *watchdog) main(ctx context.Context, applyDiff func(diff) error, remoteP
134134
}
135135
}
136136
prj := project.Get(ctx)
137+
var onlyOnceInitLog sync.Once
137138
for {
138139
select {
139140
case <-ctx.Done():
@@ -147,6 +148,9 @@ func (w *watchdog) main(ctx context.Context, applyDiff func(diff) error, remoteP
147148
}
148149
change := snapshot.diff(all)
149150
if change.IsEmpty() {
151+
onlyOnceInitLog.Do(func() {
152+
log.Printf("[INFO] Initial Sync Complete")
153+
})
150154
continue
151155
}
152156
log.Printf("[INFO] Action: %v", change)
@@ -163,6 +167,9 @@ func (w *watchdog) main(ctx context.Context, applyDiff func(diff) error, remoteP
163167
return
164168
}
165169
}
170+
onlyOnceInitLog.Do(func() {
171+
log.Printf("[INFO] Initial Sync Complete")
172+
})
166173
}
167174
}
168175
}

0 commit comments

Comments
 (0)