audit: reduce default retention delay to one year (#73513)
gitea-wip/wcs/pipeline/pr-main Build started... Details
gitea/wcs/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Thomas NOËL 2023-01-17 17:25:13 +01:00 committed by Thomas NOËL
parent 77ac56cf2f
commit 703c8da551
1 changed files with 1 additions and 1 deletions

View File

@ -94,5 +94,5 @@ class Audit(sql.Audit):
@classmethod
def clean(cls, publisher=None, **kwargs):
audit_retention_days = (publisher or get_publisher()).get_site_option('audit-retention-days') or 730
audit_retention_days = (publisher or get_publisher()).get_site_option('audit-retention-days') or 365
Audit.wipe(clause=[sql.Less('timestamp', now() - datetime.timedelta(days=int(audit_retention_days)))])