Merge pull request #41 from MinecraftXwinP/replace-recursive-by-loop

replaced recursive by infinite loop.
pull/49/head
Hunter Long 2018-08-16 08:52:57 -07:00 committed by GitHub
commit 60eaab83b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -106,12 +106,12 @@ func waitForDb(dbType string) error {
}
func DatabaseMaintence() {
defer DatabaseMaintence()
utils.Log(1, "Checking for database records older than 7 days...")
since := time.Now().AddDate(0, 0, -7)
DeleteAllSince("failures", since)
DeleteAllSince("hits", since)
time.Sleep(60 * time.Minute)
for range time.Tick(60 * time.Minute) {
utils.Log(1, "Checking for database records older than 7 days...")
since := time.Now().AddDate(0, 0, -7)
DeleteAllSince("failures", since)
DeleteAllSince("hits", since)
}
}
func DeleteAllSince(table string, date time.Time) {