feat(dfget): add --daemon option to auto-start dfdaemon#1738
Open
CormickKneey wants to merge 1 commit intodragonflyoss:mainfrom
Open
feat(dfget): add --daemon option to auto-start dfdaemon#1738CormickKneey wants to merge 1 commit intodragonflyoss:mainfrom
CormickKneey wants to merge 1 commit intodragonflyoss:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1738 +/- ##
==========================================
- Coverage 46.79% 46.36% -0.43%
==========================================
Files 87 87
Lines 24883 25115 +232
==========================================
+ Hits 11643 11644 +1
- Misses 13240 13471 +231
🚀 New features to boost your workflow:
|
Add --daemon and --daemon-manager-addr options to dfget that allow automatically starting a dfdaemon process when one is not running. The --daemon option triggers the following behavior: 1. Try connecting to existing dfdaemon via unix socket 2. If config exists, use it to start dfdaemon 3. If no config exists, generate a default one at the default path 4. If --daemon-manager-addr is specified without config, write it into the generated default config 5. If config exists and --daemon-manager-addr differs, warn the user and use the address from the config file Signed-off-by: CormickKneey <Cormick1080@gmail.com>
f8a7e36 to
adb1b73
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
--daemonflag to dfget that automatically starts a dfdaemon process when one is not already running--daemon-manager-addroption to specify the manager address for the auto-generated dfdaemon configMotivation
Currently dfget requires a running dfdaemon process to function. This makes it inconvenient for ad-hoc downloads, development, and testing scenarios where users need to manually ensure dfdaemon is running. The
--daemonoption allows dfget to handle this automatically.Behavior
When
--daemonis specified, dfget follows this logic:--daemon-manager-addrspecified → generate a default config with the specified manager address--daemon-manager-addrdiffers from config → warn the user and proceed with the config file addressUsage Examples
Changes
dragonfly-client/src/bin/dfget/main.rs: Added--daemonand--daemon-manager-addrCLI arguments,ensure_dfdaemon_config(),find_dfdaemon_binary(),start_dfdaemon(),wait_for_dfdaemon_ready()functions, and updatedmain()with the auto-start branching logic