mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-16 19:07:48 +00:00
Add RemoveOldAuditCronJob to clean up outdated audit trails
- Introduced `RemoveOldAuditCronJob` class implementing `CronJobInterface` to delete old audit trails based on configured retention period. - Added `deleteBefore` method to `AuditTrailRepository` to handle removal of records older than the specified date. - Created `RemoveOldAuditCronJobTest` to ensure correct functionality for job execution and canRun logic. - Updated DI configuration to include the `delete_after` parameter for audit trail retention settings.
This commit is contained in:
@@ -325,6 +325,12 @@ class Configuration implements ConfigurationInterface
|
||||
->end()
|
||||
->end();
|
||||
|
||||
$rootNode->children()
|
||||
->arrayNode('audit_trail')->addDefaultsIfNotSet()->children()
|
||||
->scalarNode('delete_after')->cannotBeEmpty()->defaultValue('P6M')->info('The duration (a valid interval) before deleting the audit trail. Will be run by a cronjob.')->end()
|
||||
->end()
|
||||
->end();
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user