保存三数据库日志与三十天清理实现,继续补充验收
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-08 22:30:50 +08:00
1 parent 9bdf866a87
commit 5faadcd6eb
41 files changed
+1994 -59

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
// Package logpolicy 统一三类日志的滚动保留期限。
package logpolicy
import "time"
const (
Retention = 30 * 24 * time.Hour
CompressionAge = 7 * 24 * time.Hour
MaintenanceInterval = time.Hour
DeleteBatchSize = 1000
)
// Cutoff 使用绝对时长,避免月份长度、时区或夏令时改变保留期。
func Cutoff(now time.Time) time.Time {
return now.UTC().Add(-Retention)
}