-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Torrent does not download when removing read block from cache #211
Comments
Of course. After the peer sends all the piece chunks, they are re-read to get hashed. So you can only remove it after that technically. You also need to disable upload, disable Have messages sent to peers as it'll fail reading. |
How can it be done programmatically ? |
I'll be fine with a PR to add smth like "on_piece_completed" callback to TorrentStorage |
Ok seems good yes, I'll handle it ;) |
I'm trying to implement a custom
TorrentStorage
where pieces would be remove from this storage when being read by a client, to prevent much memory from being used.The implementation is quite simple, and does not change much from your custom
InMemoryStorageExample
implementation.When I keep all pieces in storage, everything works fine, but obviously memory goes up. With the following code, torrent does not download at all :
Are you for example reading the Storage when a block has been added using
pwrite_all
? This would explain the issue I have as block would be remove directly after being downloaded.I'm using
rqbit
vendored from git directly, with latest versionv7.0.0-beta3
The text was updated successfully, but these errors were encountered: