feat: show daemon config in 'bd daemon --status' output
Add auto-commit, auto-push, local mode, sync interval, and daemon mode to the status output when querying a running daemon. This helps users understand the current daemon configuration without having to check logs or remember what flags were used at startup. Changes: - Add config fields to StatusResponse in protocol.go - Add SetConfig() method to Server for daemon to set its config - Update handleStatus() to include config in response - Update showDaemonStatus() to query and display config via RPC - Add comprehensive test coverage for new functionality Co-authored-by: Christian Catalan <crcatala@gmail.com>
This commit is contained in:
@@ -276,6 +276,15 @@ func (s *Server) handleStatus(_ *Request) Response {
|
||||
}
|
||||
}
|
||||
|
||||
// Read config under lock
|
||||
s.mu.RLock()
|
||||
autoCommit := s.autoCommit
|
||||
autoPush := s.autoPush
|
||||
localMode := s.localMode
|
||||
syncInterval := s.syncInterval
|
||||
daemonMode := s.daemonMode
|
||||
s.mu.RUnlock()
|
||||
|
||||
statusResp := StatusResponse{
|
||||
Version: ServerVersion,
|
||||
WorkspacePath: s.workspacePath,
|
||||
@@ -286,6 +295,11 @@ func (s *Server) handleStatus(_ *Request) Response {
|
||||
LastActivityTime: lastActivity.Format(time.RFC3339),
|
||||
ExclusiveLockActive: lockActive,
|
||||
ExclusiveLockHolder: lockHolder,
|
||||
AutoCommit: autoCommit,
|
||||
AutoPush: autoPush,
|
||||
LocalMode: localMode,
|
||||
SyncInterval: syncInterval,
|
||||
DaemonMode: daemonMode,
|
||||
}
|
||||
|
||||
data, _ := json.Marshal(statusResp)
|
||||
|
||||
Reference in New Issue
Block a user