mirror of
https://github.com/sismics/docs.git
synced 2024-11-26 07:34:55 +01:00
inbox service logs
This commit is contained in:
parent
65b038afcd
commit
c511ed380e
@ -74,10 +74,12 @@ public class AppContext {
|
|||||||
Config luceneStorageConfig = configDao.getById(ConfigType.LUCENE_DIRECTORY_STORAGE);
|
Config luceneStorageConfig = configDao.getById(ConfigType.LUCENE_DIRECTORY_STORAGE);
|
||||||
indexingService = new IndexingService(luceneStorageConfig != null ? luceneStorageConfig.getValue() : null);
|
indexingService = new IndexingService(luceneStorageConfig != null ? luceneStorageConfig.getValue() : null);
|
||||||
indexingService.startAsync();
|
indexingService.startAsync();
|
||||||
|
indexingService.awaitRunning();
|
||||||
|
|
||||||
// Start inbox service
|
// Start inbox service
|
||||||
inboxService = new InboxService();
|
inboxService = new InboxService();
|
||||||
inboxService.startAsync();
|
inboxService.startAsync();
|
||||||
|
indexingService.awaitRunning();
|
||||||
|
|
||||||
// Register fonts
|
// Register fonts
|
||||||
PdfUtil.registerFonts();
|
PdfUtil.registerFonts();
|
||||||
|
@ -54,7 +54,11 @@ public class InboxService extends AbstractScheduledService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void runOneIteration() {
|
protected void runOneIteration() {
|
||||||
|
try {
|
||||||
syncInbox();
|
syncInbox();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Exception during inbox synching", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,7 +81,7 @@ public class InboxService extends AbstractScheduledService {
|
|||||||
try {
|
try {
|
||||||
inbox = openInbox();
|
inbox = openInbox();
|
||||||
Message[] messages = inbox.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));
|
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) {
|
for (Message message : messages) {
|
||||||
importMessage(message);
|
importMessage(message);
|
||||||
lastSyncMessageCount++;
|
lastSyncMessageCount++;
|
||||||
@ -131,7 +135,7 @@ public class InboxService extends AbstractScheduledService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Scheduler scheduler() {
|
protected Scheduler scheduler() {
|
||||||
return Scheduler.newFixedDelaySchedule(0, 15, TimeUnit.MINUTES);
|
return Scheduler.newFixedDelaySchedule(0, 1, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user