Skip to content

Cache successful client memory scans briefly (#60) - #71

Open
elgegeto wants to merge 3 commits into
NikolayIT:masterfrom
elgegeto:fix/issue-60-cache-successful-scans
Open

elgegeto wants to merge 3 commits into
NikolayIT:masterfrom
elgegeto:fix/issue-60-cache-successful-scans

Conversation

@elgegeto

Copy link
Copy Markdown

Closes #60.

When a running client is found, reuse the values read from its memory for five seconds instead of scanning the process once per torrent. The existing 60-second cache for unsuccessful searches stays in place.

The cache stores only values actually read from memory. Missing fields still come from each torrent's own generated fallback, rather than being copied from the first torrent. Regenerate Identity bypasses both caches and performs a fresh scan.

Updated the scanner tests and added a factory-level test that creates 1,000 torrents with a fake running uTorrent process and checks that its memory is opened only once.

I haven't benchmarked a real running uTorrent or run .NET 10 tests locally; the SDK and uTorrent aren't available here. CI and a real-client performance check are still needed.

Reuse extracted values for five seconds and apply missing fields from each call's own fallback. Keep missed-scan caching and force refresh intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Starting many torrents reads a running uTorrent's memory once per torrent

1 participant