feat: changr size after delete data

This commit is contained in:
fearlseefe 2024-11-27 13:50:14 +08:00 committed by Chen Kai
parent f81ca9b344
commit de4294e9c2

View file

@ -205,6 +205,8 @@ func (c *ContentStorage) Put(contentKey []byte, contentId []byte, content []byte
c.sizeChan <- struct{}{} c.sizeChan <- struct{}{}
return err return err
} }
} else {
c.capacityChan <- c.size
} }
c.sizeChan <- struct{}{} c.sizeChan <- struct{}{}
return nil return nil
@ -273,6 +275,8 @@ func (c *ContentStorage) prune() error {
if err != nil { if err != nil {
return err return err
} }
c.size -= curentSize
c.capacityChan <- c.size - curentSize
return nil return nil
} }