mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-11 10:18:08 +09:00
Update logs
This commit is contained in:
parent
7093b32094
commit
e902b79635
2 changed files with 4 additions and 5 deletions
|
@ -7,8 +7,6 @@ import (
|
|||
"fmt"
|
||||
"sync"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/anyproto/any-sync/commonspace/object/accountdata"
|
||||
"github.com/anyproto/any-sync/commonspace/object/acl/liststorage"
|
||||
"github.com/anyproto/any-sync/consensus/consensusproto"
|
||||
|
@ -209,7 +207,6 @@ func (a *aclList) AddRawRecords(rawRecords []*consensusproto.RawRecordWithId) er
|
|||
return err
|
||||
}
|
||||
}
|
||||
log.Debug("inner records updated, final state", zap.String("head", a.Head().Id), zap.Int("len(total)", len(a.Records())))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ func (s *syncAcl) AddRawRecord(rawRec *consensusproto.RawRecordWithId) (err erro
|
|||
if s.isClosed {
|
||||
return ErrSyncAclClosed
|
||||
}
|
||||
log.Debug("received update", zap.String("aclId", s.AclList.Id()), zap.String("prevHead", s.AclList.Head().Id), zap.String("newHead", rawRec.Id))
|
||||
err = s.AclList.AddRawRecord(rawRec)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -119,12 +120,13 @@ func (s *syncAcl) AddRawRecords(rawRecords []*consensusproto.RawRecordWithId) (e
|
|||
return ErrSyncAclClosed
|
||||
}
|
||||
prevHead := s.AclList.Head().Id
|
||||
log.Debug("received updates", zap.String("aclId", s.AclList.Id()), zap.String("prevHead", prevHead), zap.String("lastHead", rawRecords[len(rawRecords)-1].Id))
|
||||
log := log.With(zap.String("aclId", s.AclList.Id()), zap.String("prevHead", prevHead))
|
||||
log.Debug("received updates", zap.String("newHead", rawRecords[len(rawRecords)-1].Id))
|
||||
err = s.AclList.AddRawRecords(rawRecords)
|
||||
if err != nil || s.AclList.Head().Id == prevHead {
|
||||
return
|
||||
}
|
||||
log.Debug("records updated, final state", zap.String("head", s.AclList.Head().Id), zap.Int("len(total)", len(s.AclList.Records())))
|
||||
log.Debug("records updated", zap.String("head", s.AclList.Head().Id), zap.Int("len(total)", len(s.AclList.Records())))
|
||||
headUpdate := s.syncClient.CreateHeadUpdate(s, rawRecords)
|
||||
s.headUpdater.UpdateHeads(s.Id(), []string{rawRecords[len(rawRecords)-1].Id})
|
||||
s.syncClient.Broadcast(headUpdate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue