mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-04 15:17:27 +00:00
fix(tgbot): apply bot settings on panel restart without full service restart
The Telegram bot's config (enable flag, token, proxy, API server) was read only during a full server.Start(). The in-process "Restart Panel" path (StopPanelOnly/StartPanelOnly -> stop/start with the bot flag false) skipped the bot entirely, so enabling the bot or changing its proxy did not take effect until a full OS-level `systemctl restart x-ui`. Cycle the Telegram bot in the panel-only restart path while still leaving Xray and the traffic writer untouched (preserving the #4265 freeze fix), so "Restart Panel" reconciles the bot with the latest settings. Fixes #5033
This commit is contained in:
parent
abf6b8799e
commit
3d6ff2b60c
1 changed files with 2 additions and 4 deletions
|
|
@ -358,9 +358,8 @@ func (s *Server) Start() (err error) {
|
|||
return s.start(true, true)
|
||||
}
|
||||
|
||||
// StartPanelOnly initializes the panel during an in-process panel restart without cycling Xray.
|
||||
func (s *Server) StartPanelOnly() (err error) {
|
||||
return s.start(false, false)
|
||||
return s.start(false, true)
|
||||
}
|
||||
|
||||
func (s *Server) start(restartXray bool, startTgBot bool) (err error) {
|
||||
|
|
@ -465,9 +464,8 @@ func (s *Server) Stop() error {
|
|||
return s.stop(true, true)
|
||||
}
|
||||
|
||||
// StopPanelOnly stops only panel-owned HTTP/background resources for an in-process panel restart.
|
||||
func (s *Server) StopPanelOnly() error {
|
||||
return s.stop(false, false)
|
||||
return s.stop(false, true)
|
||||
}
|
||||
|
||||
func (s *Server) stop(stopXray bool, stopTgBot bool) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue