mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Removed extraneous fmt.
Former-commit-id: e14a3f63333e04d7dd36445af59971bf4483e38c [formerly 0d230b0ee7017a88627c3829cb3e25723ce16909] [formerly 448638670a680e4e7d69b43ee8024a9cb09dc743 [formerly 3f3cc1f41a
]]
Former-commit-id: e8c31b3325d1b75a4b18bb9bcf842a00f5cf6ee8 [formerly 52fba3f6529f7271ed2f3ab3f9c7174acb8276c7]
Former-commit-id: 1db89f1ce6fe1d62f73c71baabb01500b9ec0117
This commit is contained in:
parent
4d34638b81
commit
e9f97aa384
@ -1,9 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "time"
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
var bannedIPs []string
|
var bannedIPs []string
|
||||||
|
|
||||||
@ -13,7 +10,6 @@ func init() {
|
|||||||
|
|
||||||
func clearBannedIPs() {
|
func clearBannedIPs() {
|
||||||
for {
|
for {
|
||||||
fmt.Println("CLEARING IPS!!")
|
|
||||||
bannedIPs = []string{}
|
bannedIPs = []string{}
|
||||||
time.Sleep(3 * time.Minute)
|
time.Sleep(3 * time.Minute)
|
||||||
}
|
}
|
||||||
@ -23,7 +19,7 @@ func isIPBanned(ip string) bool {
|
|||||||
if stringInSlice(ip, bannedIPs) {
|
if stringInSlice(ip, bannedIPs) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
bannedIPs = append(bannedIPs, ip)
|
bannedIPs = append(bannedIPs, ip)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user