fix: route channellist/clientlist/serverinfo through Exec() for reconnect-on-EOF
Some checks failed
Build ts6-viewer / build (push) Failing after 16s
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:
parent
847969b3fc
commit
3741aa3ae5
3 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue