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

This commit is contained in:
Gani Georgiev committed 2024-07-06 14:04:06 +03:00
1 parent 10ac417d96
commit 2036287a39
35 files changed
+120 -55

No files matched your search

+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)