fix: route channellist/clientlist/serverinfo through Exec() for reconnect-on-EOF
Some checks failed
Build ts6-viewer / build (push) Failing after 16s

These callers used unexported ssh.exec() directly, bypassing execSafe()
and its reconnect-on-connection-error logic. When TS6 closed the
persistent SSH session, every HTTP request returned EOF until container
restart. The exported Exec() wraps each call in execSafe which retries
once on isConnectionError with a fresh session.
This commit is contained in:
joshii-h 2026-04-20 14:10:33 +02:00
parent 847969b3fc
commit 3741aa3ae5
3 changed files with 3 additions and 3 deletions

View file

@ -31,7 +31,7 @@ type Channel struct {
// GetChannelList retrieves all channels using ServerQuery (SSH)
func GetChannelList(cfg *config.Config, ssh *SSHClient) ([]Channel, error) {
raw, err := ssh.exec("channellist -topic -flags -limits -voice -icon -secondsempty")
raw, err := ssh.Exec("channellist -topic -flags -limits -voice -icon -secondsempty")
if err != nil {
return nil, fmt.Errorf("failed to execute channellist: %w", err)
}

View file

@ -45,7 +45,7 @@ func GetClientList(cfg *config.Config, ssh *SSHClient) ([]Client, error) {
voiceCmd = "-voice"
}
raw, err := ssh.exec("clientlist -uid -away -groups -times -info -country -icon " + voiceCmd)
raw, err := ssh.Exec("clientlist -uid -away -groups -times -info -country -icon " + voiceCmd)
if err != nil {
return nil, fmt.Errorf("failed to execute clientlist: %w", err)
}

View file

@ -22,7 +22,7 @@ type ServerInfo struct {
}
func GetServerInfo(cfg *config.Config, c *SSHClient) (*ServerInfo, error) {
raw, err := c.exec("serverinfo")
raw, err := c.Exec("serverinfo")
if err != nil {
return nil, fmt.Errorf("failed to execute serverinfo: %w", err)
}