mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-02-22 16:25:43 +02:00
[#5179] fixed days calculation for triggering old logs deletion
This commit is contained in:
parent
f1aa477378
commit
10ac417d96
@ -1261,7 +1261,7 @@ func (app *BaseApp) initLogger() error {
|
||||
logsMaxDays := app.Settings().Logs.MaxDays
|
||||
now := time.Now()
|
||||
lastLogsDeletedAt := cast.ToTime(app.Store().Get("lastLogsDeletedAt"))
|
||||
daysDiff := now.Sub(lastLogsDeletedAt).Hours() * 24
|
||||
daysDiff := now.Sub(lastLogsDeletedAt).Hours() / 24
|
||||
if daysDiff > float64(logsMaxDays) {
|
||||
deleteErr := app.LogsDao().DeleteOldLogs(now.AddDate(0, 0, -1*logsMaxDays))
|
||||
if deleteErr == nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user