refactor(downloader): rename client method and increase timeout #1311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request refactors the client management logic in
piece_downloader.rs
to streamline how client entries are retrieved and used, and adjusts the idle timeout and logging for client cleanup. The main changes focus on simplifying client entry access, improving code clarity, and making idle client cleanup more visible.Client management and code simplification:
client
method toclient_entry
and updated its return type to return the fullDfdaemonUploadClientEntry
instead of just the client, consolidating client retrieval logic and removing the now-unnecessaryget_client_entry
method. [1] [2]client_entry
, simplifying the code by removing redundant client lookups and ensuring only a single path to retrieve a client entry. [1] [2] [3]Timeout and logging improvements:
debug!
toinfo!
when removing idle clients, making these events more visible in logs.Related Issue
Motivation and Context
Screenshots (if appropriate)