mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-11-29 10:52:54 +00:00
Compare commits
2 commits
68719eef34
...
1150589730
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1150589730 | ||
|
|
9936af80dd |
1 changed files with 8 additions and 0 deletions
8
main.go
8
main.go
|
|
@ -78,6 +78,10 @@ func runWebServer() {
|
||||||
case syscall.SIGHUP:
|
case syscall.SIGHUP:
|
||||||
logger.Info("Received SIGHUP signal. Restarting servers...")
|
logger.Info("Received SIGHUP signal. Restarting servers...")
|
||||||
|
|
||||||
|
// --- FIX FOR TELEGRAM BOT CONFLICT (409): Stop bot before restart ---
|
||||||
|
service.StopBot()
|
||||||
|
// --
|
||||||
|
|
||||||
err := server.Stop()
|
err := server.Stop()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Debug("Error stopping web server:", err)
|
logger.Debug("Error stopping web server:", err)
|
||||||
|
|
@ -106,6 +110,10 @@ func runWebServer() {
|
||||||
log.Println("Sub server restarted successfully.")
|
log.Println("Sub server restarted successfully.")
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
// --- FIX FOR TELEGRAM BOT CONFLICT (409) on full shutdown ---
|
||||||
|
service.StopBot()
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
server.Stop()
|
server.Stop()
|
||||||
subServer.Stop()
|
subServer.Stop()
|
||||||
log.Println("Shutting down servers.")
|
log.Println("Shutting down servers.")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue