update static web and fix merge

This commit is contained in:
nikk gitanes
2023-10-05 03:56:16 +03:00
parent b6531aadd9
commit 8c8fe1848e
13 changed files with 43 additions and 43 deletions

View File

@@ -25,20 +25,20 @@ func NewStorage(capacity int64) *Storage {
}
func (s *Storage) OpenTorrent(info *metainfo.Info, infoHash metainfo.Hash) (ts.TorrentImpl, error) {
capFunc := func() (int64, bool) {
return s.capacity, true
}
// capFunc := func() (int64, bool) {
// return s.capacity, true
// }
s.mu.Lock()
defer s.mu.Unlock()
ch := NewCache(s.capacity, s)
ch.Init(info, infoHash)
s.caches[infoHash] = ch
return ch, nil
// return ts.TorrentImpl{
// Piece: ch.Piece,
// Close: ch.Close,
// Capacity: &capFunc,
// }, nil
// return ts.TorrentImpl{
// Piece: ch.Piece,
// Close: ch.Close,
// Capacity: &capFunc,
// }, nil
}
func (s *Storage) CloseHash(hash metainfo.Hash) {