diff --git a/Makefile b/Makefile index ee77122..718d4cb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -VERSION=0.2.32 +VERSION=0.2.33 APP=reseed-tools USER_GH=eyedeekay CGO_ENABLED=0 diff --git a/main.go b/main.go index f80a70d..1616bcf 100644 --- a/main.go +++ b/main.go @@ -19,7 +19,7 @@ func main() { app := cli.NewApp() app.Name = "reseed-tools" - app.Version = "0.2.32" + app.Version = "0.2.33" app.Usage = "I2P tools and reseed server" auth := &cli.Author{ Name: "eyedeekay", diff --git a/reseed/ping.go b/reseed/ping.go index ed93804..c8275f2 100644 --- a/reseed/ping.go +++ b/reseed/ping.go @@ -97,7 +97,20 @@ var AllReseeds = []string{ "https://www2.mk16.de/", } +func yday() time.Time { + today := time.Now() + yesterday := today.Add(-24 * time.Hour) + return yesterday +} + +var lastPing = yday() + func PingEverybody() []string { + if lastPing.After(yday()) { + log.Println("Your ping was rate-limited") + return nil + } + lastPing = time.Now() var nonerrs []string for _, urlInput := range AllReseeds { err := PingWriteContent(urlInput)