Revert "dev add violation notion"
Test Workflow / test (push) Successful in 3s

This reverts commit 4ff5c5ec13.
This commit is contained in:
vladp
2026-03-20 16:02:11 +07:00
parent a9b7b7ca6e
commit 726da25ddf
9 changed files with 153 additions and 350 deletions
@@ -34,6 +34,8 @@ public class FileCleanupService {
public void cleanupExpiredFiles() {
log.info("Starting cleanup of expired temporary files");
// cleanupOldPeriods();
Path tempDir = Paths.get(basePath, "temp");
if (!Files.exists(tempDir)) {
return;
@@ -83,4 +85,17 @@ public class FileCleanupService {
log.error("Error during cleanup", e);
}
}
private void cleanupOldPeriods() {
LocalDate thirtyDaysAgo = LocalDate.now().minusDays(30);
List<ProtectedFileCheck> checks = protectedFileCheckRepository.findByPeriodStartDateBefore(thirtyDaysAgo);
for (ProtectedFileCheck check : checks) {
check.cleanupOldData();
}
protectedFileCheckRepository.saveAll(checks);
log.info("Cleaned up {} old protection usage records", checks.size());
}
}