download: free the -j slot once a torrent starts seeding
This commit is contained in:
@@ -64,3 +64,14 @@ type Download interface {
|
||||
Run(ctx context.Context) error
|
||||
Stat() Stat
|
||||
}
|
||||
|
||||
// Seeder is an optional capability of a Download whose work continues after its
|
||||
// content is fully downloaded — a torrent that keeps running to seed.
|
||||
// SeedingStarted is closed at that download->seed transition. The engine uses it
|
||||
// to free the concurrency slot the moment a download stops downloading: a
|
||||
// seed-only torrent is no longer a download, so it must not count against
|
||||
// --max-concurrent-downloads (-j) and block a queued download. HTTP downloads do
|
||||
// not implement this, so they hold their slot until they finish.
|
||||
type Seeder interface {
|
||||
SeedingStarted() <-chan struct{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user