mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-08-30 06:46:17 +00:00
added 5 seconds delay before cleaning logs
This commit is contained in:
parent
26d12120fd
commit
289a33675f
2 changed files with 5 additions and 2 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type CheckClientIpJob struct {
|
||||
|
@ -97,7 +98,9 @@ func processLogFile() {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
time.Sleep(time.Second * 5)
|
||||
//added 5 seconds delay before cleaning logs to reduce chance of logging IP that already has been banned
|
||||
if shouldCleanLog {
|
||||
// clean log
|
||||
if err := os.Truncate(GetAccessLogPath(), 0); err != nil {
|
||||
|
|
|
@ -250,7 +250,7 @@ func (s *Server) startTask() {
|
|||
// Check the inbound traffic every 30 seconds that the traffic exceeds and expires
|
||||
s.cron.AddJob("@every 30s", job.NewCheckInboundJob())
|
||||
|
||||
// check client ips from log file every 10 sec
|
||||
// check client ips from log file every 30 sec
|
||||
s.cron.AddJob("@every 30s", job.NewCheckClientIpJob())
|
||||
|
||||
// Make a traffic condition every day, 8:30
|
||||
|
|
Loading…
Reference in a new issue