File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,11 +158,11 @@ func (m *Module) sync(ctx context.Context) error {
158158 cids := make (map [string ]storage.Celestial )
159159 addressIds := make (map [uint64 ]struct {})
160160
161+ var lastId int64
161162 for i := range changes .Changes {
162163 if m .state .ChangeId >= changes .Changes [i ].ChangeID {
163164 continue
164165 }
165- m .state .ChangeId = changes .Changes [i ].ChangeID
166166 addressId , err := m .addressHandler (ctx , changes .Changes [i ].Address )
167167 if err != nil {
168168 return errors .Wrap (err , "address handler" )
@@ -184,11 +184,13 @@ func (m *Module) sync(ctx context.Context) error {
184184 ChangeId : changes .Changes [i ].ChangeID ,
185185 Status : status ,
186186 }
187+ lastId = changes .Changes [i ].ChangeID
187188 }
188189
189190 if err := m .save (ctx , cids , addressIds ); err != nil {
190191 return errors .Wrap (err , "save" )
191192 }
193+ m .state .ChangeId = lastId
192194 log .Debug ().
193195 Int ("changes_count" , len (cids )).
194196 Int64 ("head" , m .state .ChangeId ).
You can’t perform that action at this time.
0 commit comments