Update counters

This commit is contained in:
mcrakhman 2023-03-13 13:04:23 +01:00
parent 6b2667d4dc
commit a2efcafb3e
No known key found for this signature in database
GPG Key ID: DED12CFEF5B8396B

View File

@ -330,8 +330,8 @@ func (s *space) BuildTree(ctx context.Context, id string, opts BuildTreeOpts) (t
if t, err = synctree.BuildSyncTreeOrGetRemote(ctx, id, deps); err != nil {
return nil, err
}
log.Debug("incrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()+1), zap.String("spaceId", s.id))
s.treesUsed.Add(1)
log.Debug("incrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()), zap.String("spaceId", s.id))
return
}
@ -406,8 +406,8 @@ func (s *space) handleMessage(msg HandleMessage) {
}
func (s *space) onObjectClose(id string) {
log.Debug("decrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()+1), zap.String("spaceId", s.id))
s.treesUsed.Add(-1)
log.Debug("decrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()), zap.String("spaceId", s.id))
_ = s.handleQueue.CloseThread(id)
}