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

This commit is contained in:
vladp
2026-03-20 15:26:20 +07:00
parent 037445dcd5
commit 4ff5c5ec13
9 changed files with 348 additions and 151 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());
}
}