mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 07:07:57 +01:00
fix reindexing on application startup
This commit is contained in:
parent
e72dab2a6e
commit
b3349176d9
@ -64,9 +64,9 @@ public class AppContext {
|
|||||||
private List<ExecutorService> asyncExecutorList;
|
private List<ExecutorService> asyncExecutorList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor.
|
* Start the application context.
|
||||||
*/
|
*/
|
||||||
private AppContext() {
|
private void startUp() {
|
||||||
resetEventBus();
|
resetEventBus();
|
||||||
|
|
||||||
// Start indexing handler
|
// Start indexing handler
|
||||||
@ -74,7 +74,7 @@ public class AppContext {
|
|||||||
try {
|
try {
|
||||||
indexingHandler.startUp();
|
indexingHandler.startUp();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error starting the indexing handler, rebuilding the index", e);
|
log.error("Error starting the indexing handler, rebuilding the index: " + e.getMessage());
|
||||||
RebuildIndexAsyncEvent rebuildIndexAsyncEvent = new RebuildIndexAsyncEvent();
|
RebuildIndexAsyncEvent rebuildIndexAsyncEvent = new RebuildIndexAsyncEvent();
|
||||||
asyncEventBus.post(rebuildIndexAsyncEvent);
|
asyncEventBus.post(rebuildIndexAsyncEvent);
|
||||||
}
|
}
|
||||||
@ -138,6 +138,7 @@ public class AppContext {
|
|||||||
public static AppContext getInstance() {
|
public static AppContext getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new AppContext();
|
instance = new AppContext();
|
||||||
|
instance.startUp();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ public class DialectUtil {
|
|||||||
* @return Object not found
|
* @return Object not found
|
||||||
*/
|
*/
|
||||||
public static boolean isObjectNotFound(String message) {
|
public static boolean isObjectNotFound(String message) {
|
||||||
return EMF.isDriverH2() && message.contains("object not found") ||
|
return EMF.isDriverH2() && message.contains("not found") ||
|
||||||
EMF.isDriverPostgresql() && message.contains("does not exist");
|
EMF.isDriverPostgresql() && message.contains("does not exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user