feat: Add skipping domain if checked recently
This commit is contained in:
parent
321b77b9ac
commit
4e0038506d
1 changed files with 19 additions and 0 deletions
19
main.go
19
main.go
|
@ -25,6 +25,11 @@ func main() {
|
|||
},
|
||||
}
|
||||
|
||||
recent := make([]string, 20)
|
||||
for i := range recent {
|
||||
recent[i] = ""
|
||||
}
|
||||
|
||||
stream, errStream := certstream.CertStreamEventStream(false)
|
||||
for {
|
||||
select {
|
||||
|
@ -64,10 +69,24 @@ func main() {
|
|||
if domain[0] == '*' || domain == "sni.cloudflaressl.com" {
|
||||
continue
|
||||
}
|
||||
|
||||
// skip if was checked recently
|
||||
skip := false
|
||||
for _, recentDomain := range recent {
|
||||
if domain == recentDomain {
|
||||
skip = true
|
||||
}
|
||||
}
|
||||
if skip {
|
||||
continue
|
||||
}
|
||||
|
||||
log.Println("checking " + domain)
|
||||
go c.CheckGit(domain)
|
||||
go c.CheckEnv(domain)
|
||||
go c.CheckIndex(domain)
|
||||
|
||||
recent = append(recent[1:], domain)
|
||||
}
|
||||
|
||||
case err := <-errStream:
|
||||
|
|
Loading…
Reference in a new issue