mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
change job run time
This commit is contained in:
@@ -104,7 +104,7 @@ func processLogFile() {
|
||||
// check if inbound connection is more than limited ip and drop connection
|
||||
LimitDevice := func() { LimitDevice() }
|
||||
|
||||
stop := schedule(LimitDevice, 1000 *time.Millisecond)
|
||||
stop := schedule(LimitDevice, 700 *time.Millisecond)
|
||||
time.Sleep(60 * time.Second)
|
||||
stop <- true
|
||||
|
||||
@@ -213,21 +213,6 @@ func GetInboundByEmail(clientEmail string) (*model.Inbound, error) {
|
||||
return inbounds, nil
|
||||
}
|
||||
|
||||
func DisableInbound(id int) error {
|
||||
db := database.GetDB()
|
||||
result := db.Model(model.Inbound{}).
|
||||
Where("id = ? and enable = ?", id, true).
|
||||
Update("enable", false)
|
||||
err := result.Error
|
||||
logger.Warning("disable inbound with id:",id)
|
||||
|
||||
if err == nil {
|
||||
job.xrayService.SetToNeedRestart()
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func LimitDevice(){
|
||||
|
||||
localIp,err := LocalIP()
|
||||
|
||||
@@ -296,8 +296,8 @@ func (s *Server) startTask() {
|
||||
// 每 30 秒检查一次 inbound 流量超出和到期的情况
|
||||
s.cron.AddJob("@every 30s", job.NewCheckInboundJob())
|
||||
|
||||
// check client ips from log file every 1 min
|
||||
s.cron.AddJob("@every 1m", job.NewCheckClientIpJob())
|
||||
// check client ips from log file every 30 sec
|
||||
s.cron.AddJob("@every 30s", job.NewCheckClientIpJob())
|
||||
|
||||
// 每一天提示一次流量情况,上海时间8点30
|
||||
var entry cron.EntryID
|
||||
|
||||
Reference in New Issue
Block a user