fix engine bug

This commit is contained in:
YouROK
2021-02-01 22:00:52 +03:00
parent 63e9e97d8e
commit e3603f7bb8

View File

@@ -6,6 +6,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/storage" "github.com/anacrolix/torrent/storage"
) )
@@ -102,6 +103,12 @@ func (p *Piece) Release() {
} }
p.Size = 0 p.Size = 0
p.complete = false p.complete = false
//Костыль чтобы двиг понял что куска нет, иногда загружает его по новый хз почему
pce := p.cache.torrent.Piece(p.Id)
pce.SetPriority(torrent.PiecePriorityNone)
pce.UpdateCompletion()
pce.SetPriority(torrent.PiecePriorityNone)
} }
func WriteToDisk(b []byte, off int64) (n int, err error) { func WriteToDisk(b []byte, off int64) (n int, err error) {