mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-20 08:47:16 +08:00
docs: add comments for all functions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user