replaced recursive by infinite loop.

pull/41/head
minecraftxwinp 2018-07-29 00:44:52 +08:00
parent c27f6a6f30
commit b2bccd0948
1 changed files with 6 additions and 6 deletions

View File

@ -90,12 +90,12 @@ func waitForDb(dbType string) error {
}
func DatabaseMaintence() {
defer DatabaseMaintence()
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)
time.Sleep(60 * time.Minute)
}
}
func DeleteAllSince(table string, date time.Time) {