39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package job
|
|
|
|
import (
|
|
"github.com/mhsanaei/3x-ui/v3/internal/web/service/probenotify"
|
|
)
|
|
|
|
// ProbeNotifyJob is the notification sweep (item 7 B6): every 30s it
|
|
// examines agent connectivity and billing-period traffic and queues
|
|
// the offline / recovery / traffic alerts. The engine swallows its
|
|
// own failures into log lines — a broken notification pass must
|
|
// never disturb the panel.
|
|
type ProbeNotifyJob struct{}
|
|
|
|
// NewProbeNotifyJob creates a probe notification sweep job instance.
|
|
func NewProbeNotifyJob() *ProbeNotifyJob {
|
|
return new(ProbeNotifyJob)
|
|
}
|
|
|
|
// Run executes one sweep pass.
|
|
func (j *ProbeNotifyJob) Run() {
|
|
probenotify.Sweep()
|
|
}
|
|
|
|
// ProbeNotifyHousekeepingJob is the hourly half (item 7 B6): roll
|
|
// online nodes' expiry dates forward, then send the day's expiry
|
|
// digest over the dates as they now stand.
|
|
type ProbeNotifyHousekeepingJob struct{}
|
|
|
|
// NewProbeNotifyHousekeepingJob creates a probe notification
|
|
// housekeeping job instance.
|
|
func NewProbeNotifyHousekeepingJob() *ProbeNotifyHousekeepingJob {
|
|
return new(ProbeNotifyHousekeepingJob)
|
|
}
|
|
|
|
// Run executes one housekeeping pass.
|
|
func (j *ProbeNotifyHousekeepingJob) Run() {
|
|
probenotify.Housekeeping()
|
|
}
|