[#5179] added logs delete trigger test and bumped app version

This commit is contained in:
Gani Georgiev
2024-07-06 14:03:10 +03:00
parent 10ac417d96
commit 2036287a39
35 changed files with 120 additions and 55 deletions
+1 -1
View File
@@ -1262,7 +1262,7 @@ func (app *BaseApp) initLogger() error {
now := time.Now()
lastLogsDeletedAt := cast.ToTime(app.Store().Get("lastLogsDeletedAt"))
daysDiff := now.Sub(lastLogsDeletedAt).Hours() / 24
if daysDiff > float64(logsMaxDays) {
if daysDiff >= float64(logsMaxDays) {
deleteErr := app.LogsDao().DeleteOldLogs(now.AddDate(0, 0, -1*logsMaxDays))
if deleteErr == nil {
app.Store().Set("lastLogsDeletedAt", now)