dev add violation notion

This commit is contained in:
vladp
2026-03-20 17:37:00 +07:00
parent 2bf5e99fbb
commit 29cdbb887f
9 changed files with 354 additions and 174 deletions
@@ -34,8 +34,6 @@ 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;
@@ -85,17 +83,4 @@ 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());
}
}