Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Commit

Permalink
Application start fails if no file storage is registered #44
Browse files Browse the repository at this point in the history
  • Loading branch information
gorbunkov committed Sep 22, 2021
1 parent 1e78368 commit c8103fe
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions email/src/main/java/io/jmix/email/impl/EmailCleanerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ public class EmailCleanerImpl implements EmailCleaner {
@Autowired
private FetchPlanRepository fetchPlanRepository;

private FileStorage fileStorage;

@Autowired
public void setFileStorage(FileStorageLocator fileStorageLocator) {
this.fileStorage = fileStorageLocator.getDefault();
}
private FileStorageLocator fileStorageLocator;

@Transactional
@Override
Expand All @@ -77,6 +73,7 @@ public Integer deleteOldEmails() {
}

private int deleteMessages(int ageOfMessage, boolean important) {
FileStorage fileStorage = fileStorageLocator.getDefault();
List<SendingMessage> messagesToDelete = entityManager.createQuery("select msg from email_SendingMessage msg" +
" where msg.important = :important and msg.createTs < :date", SendingMessage.class)
.setParameter("important", important)
Expand Down

0 comments on commit c8103fe

Please sign in to comment.