From a6a1748b3cc2f66e32b5df4342b15707f3a4df8c Mon Sep 17 00:00:00 2001 From: Philipp Schramm Date: Tue, 1 Feb 2022 11:41:04 +0100 Subject: [PATCH] RED-3314 Bugfix with timestamp for hardDelete method --- .../service/persistence/FileStatusPersistenceService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java index 351c350a7..208afcb45 100644 --- a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java +++ b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/persistence/FileStatusPersistenceService.java @@ -233,10 +233,9 @@ public class FileStatusPersistenceService { @Transactional public void hardDelete(String fileId) { - int countUpdate = fileRepository.setHardDelete(fileId, ProcessingStatus.DELETED, - OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS), - OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS), - OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS)); + var now = OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS); + + int countUpdate = fileRepository.setHardDelete(fileId, ProcessingStatus.DELETED, now, now, now); if (countUpdate == 0) { throw new NotFoundException("Unknown file=" + fileId); }