Pull request #212: RED-3314 Bugfix with timestamp for hardDelete method

Merge in RED/persistence-service from RED-3314 to master

* commit 'a6a1748b3cc2f66e32b5df4342b15707f3a4df8c':
  RED-3314 Bugfix with timestamp for hardDelete method
This commit is contained in:
Philipp Schramm 2022-02-01 13:40:08 +01:00
commit ac957028af

View File

@ -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);
}