fix monitor-webui failure to detect running daemon
monitor-webui fails to connect to the bd daemon because it calculates the socket path incorrectly. It expects beads.db.sock in a nested .beads directory, whereas the daemon listens on bd.sock in the .beads directory. Updated `getSocketPath` function to: - Check if dbPath directory is already .beads. - Use bd.sock as the socket name instead of [dbName].sock. - Handle both nested and non-nested cases correctly.
This commit is contained in:
@@ -111,11 +111,9 @@ func main() {
|
||||
|
||||
// getSocketPath returns the Unix socket path for the daemon
|
||||
func getSocketPath(dbPath string) string {
|
||||
// Use the database directory to determine socket path
|
||||
// The daemon always creates the socket as "bd.sock" in the same directory as the database
|
||||
dbDir := filepath.Dir(dbPath)
|
||||
dbName := filepath.Base(dbPath)
|
||||
socketName := dbName + ".sock"
|
||||
return filepath.Join(dbDir, ".beads", socketName)
|
||||
return filepath.Join(dbDir, "bd.sock")
|
||||
}
|
||||
|
||||
// connectToDaemon establishes connection to the daemon
|
||||
|
||||
Reference in New Issue
Block a user