fixed clear logs

This commit is contained in:
Malte 2022-04-06 09:05:06 +02:00
parent 7e415a710f
commit 217cb2a575

View File

@ -59,8 +59,8 @@ func (h *Handler) ShowHostLogs(c echo.Context) (err error) {
}
func (h *Handler) ClearLogs() {
var clearInterval = strconv.FormatUint(h.ClearInterval, 10) + " days"
h.DB.Exec("DELETE FROM LOGS WHERE created_at < datetime('now', '" + clearInterval + "');REINDEX LOGS;")
var clearInterval = strconv.FormatUint(h.ClearInterval, 10) + " day"
h.DB.Exec("DELETE FROM LOGS WHERE created_at < datetime('now', '-" + clearInterval + "');REINDEX LOGS;")
h.LastClearedLogs = time.Now()
log.Print("logs cleared")
}