@@ -211,20 +211,11 @@ func (s *Syncer) syncLoop(ctx context.Context, env *lmdb.Env, r *receiver.Receiv
211211 }).Debug ("Loading update" )
212212 }
213213
214- actualTxnID , localChanged , err := s .LoadOnce (
215- ctx , env , instance , update , lastSyncedTxnID )
216- update .Close () // releases the DecompressedSnapshotToken
217- if err != nil {
218- return err
219- }
220-
221214 if update .NameInfo .Kind == snapshot .KindSnapshot {
222215 nLoads ++
223- if waitingForInstances .Contains (instance ) {
224- if s .hooks .InstanceReady == nil {
225- s .l .WithField ("other_instance" , instance ).Info ("No longer waiting for instance" )
226- waitingForInstances .Remove (instance )
227- }
216+ if waitingForInstances .Contains (instance ) && s .hooks .InstanceReady == nil {
217+ s .l .WithField ("other_instance" , instance ).Info ("No longer waiting for instance" )
218+ waitingForInstances .Remove (instance )
228219 }
229220 }
230221 if waitingForInstances .Contains (instance ) && s .hooks .InstanceReady != nil {
@@ -236,6 +227,13 @@ func (s *Syncer) syncLoop(ctx context.Context, env *lmdb.Env, r *receiver.Receiv
236227 }
237228 }
238229
230+ actualTxnID , localChanged , err := s .LoadOnce (
231+ ctx , env , instance , update , lastSyncedTxnID )
232+ update .Close () // releases the DecompressedSnapshotToken
233+ if err != nil {
234+ return err
235+ }
236+
239237 // Publish a successful load
240238 s .events .UpdateLoaded .Publish (events.UpdateInfo {
241239 NameInfo : update .NameInfo ,
@@ -345,7 +343,6 @@ func (s *Syncer) syncLoop(ctx context.Context, env *lmdb.Env, r *receiver.Receiv
345343 }
346344
347345 // Sleep before next check for snapshots and local changes
348- // s.l.Debug("Waiting for a new transaction")
349346 if err := utils .SleepContext (ctx , s .c .LMDBPollInterval ); err != nil {
350347 return err
351348 }
0 commit comments