1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-09 17:45:03 +09:00

Add streampool msg size

This commit is contained in:
mcrakhman 2024-08-15 08:28:51 +02:00
parent 2989b11f3c
commit 7e9839336c
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
5 changed files with 41 additions and 5 deletions

View file

@ -62,6 +62,10 @@ func (h *HeadUpdate) MsgSize() uint64 {
return byteSize + uint64(len(h.Meta.PeerId)) + uint64(len(h.Meta.ObjectId)) + uint64(len(h.Meta.SpaceId))
}
func (h *HeadUpdate) Size() int {
return int(h.MsgSize())
}
func (h *HeadUpdate) SetPeerId(peerId string) {
h.Meta.PeerId = peerId
}

View file

@ -93,7 +93,7 @@ func (s *syncService) Run(ctx context.Context) (err error) {
func (s *syncService) Close(ctx context.Context) (err error) {
err = s.receiveQueue.Close()
if s.commonMetric != nil {
s.commonMetric.UnregisterSyncMetric(s.spaceId, s.metric)
s.commonMetric.UnregisterSyncMetric(s.spaceId)
}
s.manager.Close()
return