inbox service logs

This commit is contained in:
Benjamin Gamard 2018-03-03 14:39:12 +01:00
parent 65b038afcd
commit c511ed380e
2 changed files with 9 additions and 3 deletions

View File

@ -74,10 +74,12 @@ public class AppContext {
Config luceneStorageConfig = configDao.getById(ConfigType.LUCENE_DIRECTORY_STORAGE);
indexingService = new IndexingService(luceneStorageConfig != null ? luceneStorageConfig.getValue() : null);
indexingService.startAsync();
indexingService.awaitRunning();
// Start inbox service
inboxService = new InboxService();
inboxService.startAsync();
indexingService.awaitRunning();
// Register fonts
PdfUtil.registerFonts();

View File

@ -54,7 +54,11 @@ public class InboxService extends AbstractScheduledService {
@Override
protected void runOneIteration() {
try {
syncInbox();
} catch (Exception e) {
log.error("Exception during inbox synching", e);
}
}
/**
@ -77,7 +81,7 @@ public class InboxService extends AbstractScheduledService {
try {
inbox = openInbox();
Message[] messages = inbox.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));
log.info(messages.length + " messages found, importing...");
log.info(messages.length + " messages found");
for (Message message : messages) {
importMessage(message);
lastSyncMessageCount++;
@ -131,7 +135,7 @@ public class InboxService extends AbstractScheduledService {
@Override
protected Scheduler scheduler() {
return Scheduler.newFixedDelaySchedule(0, 15, TimeUnit.MINUTES);
return Scheduler.newFixedDelaySchedule(0, 1, TimeUnit.MINUTES);
}
/**