mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
sort Log Ips
This commit is contained in:
@@ -92,6 +92,7 @@ func processLogFile() {
|
||||
disAllowedIps = []string{}
|
||||
|
||||
for clientEmail, ips := range InboundClientIps {
|
||||
sort.Sort(sort.StringSlice(ips))
|
||||
inboundClientIps := GetInboundClientIps(clientEmail, ips)
|
||||
if inboundClientIps != nil {
|
||||
inboundsClientIps = append(inboundsClientIps, inboundClientIps)
|
||||
@@ -104,8 +105,8 @@ func processLogFile() {
|
||||
// check if inbound connection is more than limited ip and drop connection
|
||||
LimitDevice := func() { LimitDevice() }
|
||||
|
||||
stop := schedule(LimitDevice, 700 *time.Millisecond)
|
||||
time.Sleep(60 * time.Second)
|
||||
stop := schedule(LimitDevice, 100 *time.Millisecond)
|
||||
time.Sleep(11 * time.Second)
|
||||
stop <- true
|
||||
|
||||
}
|
||||
|
||||
@@ -296,8 +296,8 @@ func (s *Server) startTask() {
|
||||
// 每 30 秒检查一次 inbound 流量超出和到期的情况
|
||||
s.cron.AddJob("@every 30s", job.NewCheckInboundJob())
|
||||
|
||||
// check client ips from log file every 30 sec
|
||||
s.cron.AddJob("@every 30s", job.NewCheckClientIpJob())
|
||||
// check client ips from log file every 10 sec
|
||||
s.cron.AddJob("@every 10s", job.NewCheckClientIpJob())
|
||||
|
||||
// 每一天提示一次流量情况,上海时间8点30
|
||||
var entry cron.EntryID
|
||||
|
||||
Reference in New Issue
Block a user