diff options
| author | somebodywashere <68244480+somebodywashere@users.noreply.github.com> | 2024-01-01 18:07:56 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-01 18:07:56 +0300 |
| commit | ceee1e4277953b68aeded8af01cf2eddfee2fbd5 (patch) | |
| tree | 7ff9f21d8c300ffd45473500337cff4a45ab7b65 /web/job/check_xray_running_job.go | |
| parent | b725ea7de5ed73a36a9cd2c23bb247ca6b587573 (diff) | |
Major changes to tgbot, also small changes for panel (#1463)
* Reduce outage time on Xray errors
* Improved logs clearing, added previous logs
File name change: 3xipl-access-persistent.log -> 3xipl-ap.log
All previous logs have .prev suffix
* Preparations for tgbot additions
* [tgbot] Improvements, Additions and Fixes
* Changed interaction with Expire Date for Clients
* Added more info and interactions with Online Clients
* Added a way to get Ban Logs (also added them to backup)
* Few fixes and optimizations in code
* Fixed RU translation
* [tgbot] More updates and fixes
* [tgbot] Quick Fix
* [tgbot] Quick Fix 2
* [tgbot] Big Updates
Added Notifications for Clients throught Tgbot (when Expire)
Added compability for Usernames both w/wo @
Added more buttons overall for admins
* [tgbot] Fixes
* [tbot] Fixes 2
* [tgbot] Removed usernames support for Notifications to work
* [tgbot] Fix
* [tgbot] Fix Notify
* [tgbot] small fixes
* [tgbot] replyMarkup only for last message on big messages
* [tgbot] Fixed last message is empty
* [tgbot] Fix messages split
Diffstat (limited to 'web/job/check_xray_running_job.go')
| -rw-r--r-- | web/job/check_xray_running_job.go | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/web/job/check_xray_running_job.go b/web/job/check_xray_running_job.go index f1a848bf..d9ffeb7a 100644 --- a/web/job/check_xray_running_job.go +++ b/web/job/check_xray_running_job.go @@ -1,6 +1,9 @@ package job -import "x-ui/web/service" +import ( + "x-ui/logger" + "x-ui/web/service" +) type CheckXrayRunningJob struct { xrayService service.XrayService @@ -15,11 +18,15 @@ func NewCheckXrayRunningJob() *CheckXrayRunningJob { func (j *CheckXrayRunningJob) Run() { if j.xrayService.IsXrayRunning() { j.checkTime = 0 - return + } else { + j.checkTime++ + //only restart if it's down 2 times in a row + if j.checkTime > 1 { + err := j.xrayService.RestartXray(false) + j.checkTime = 0 + if err != nil { + logger.Error("Restart xray failed:", err) + } + } } - j.checkTime++ - if j.checkTime < 2 { - return - } - j.xrayService.SetToNeedRestart() } |
