diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
| commit | 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 (patch) | |
| tree | 28d8d82530476cf607e4d05ca189ae05868711e6 /web/job/check_xray_running_job.go | |
| parent | f60682a6b7cb749fee403c84e2587c3ad7e7ced0 (diff) | |
docs: add comments for all functions
Diffstat (limited to 'web/job/check_xray_running_job.go')
| -rw-r--r-- | web/job/check_xray_running_job.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/job/check_xray_running_job.go b/web/job/check_xray_running_job.go index 8f5f0889..5b53b0c6 100644 --- a/web/job/check_xray_running_job.go +++ b/web/job/check_xray_running_job.go @@ -1,3 +1,5 @@ +// Package job provides background job implementations for the 3x-ui web panel, +// including traffic monitoring, system checks, and periodic maintenance tasks. package job import ( @@ -5,16 +7,18 @@ import ( "github.com/mhsanaei/3x-ui/v2/web/service" ) +// CheckXrayRunningJob monitors Xray process health and restarts it if it crashes. type CheckXrayRunningJob struct { xrayService service.XrayService - - checkTime int + checkTime int } +// NewCheckXrayRunningJob creates a new Xray health check job instance. func NewCheckXrayRunningJob() *CheckXrayRunningJob { return new(CheckXrayRunningJob) } +// Run checks if Xray has crashed and restarts it after confirming it's down for 2 consecutive checks. func (j *CheckXrayRunningJob) Run() { if !j.xrayService.DidXrayCrash() { j.checkTime = 0 |
