Check piece completion state as soon as a handle to torrent data is obtained from a piece store
This helps flex the new concurrency implementation in the piece store http backend
This commit is contained in:
parent
08f8d7bd19
commit
a0f374ce8d
|
@ -40,8 +40,12 @@ func (me *store) incompletePiecePath(p metainfo.Piece) string {
|
|||
hex.EncodeToString(p.Hash()))
|
||||
}
|
||||
|
||||
func (me *store) OpenTorrentData(info *metainfo.Info) *data {
|
||||
return &data{info, me}
|
||||
func (me *store) OpenTorrentData(info *metainfo.Info) (ret *data) {
|
||||
ret = &data{info, me}
|
||||
for i := range iter.N(info.NumPieces()) {
|
||||
go ret.PieceComplete(i)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func New(db dataBackend.I) *store {
|
||||
|
|
Loading…
Reference in New Issue