|
|
@@ -150,9 +150,13 @@ Crowi.prototype.init = async function() {
|
|
|
await this.autoInstall();
|
|
|
};
|
|
|
|
|
|
-Crowi.prototype.afterInit = async function() {
|
|
|
+/**
|
|
|
+ * Execute functions that should be run after the express server is ready.
|
|
|
+ * Functions here does not block the
|
|
|
+ */
|
|
|
+Crowi.prototype.asyncAfterExpressServerReady = async function() {
|
|
|
if (this.pageOperationService != null) {
|
|
|
- this.pageOperationService.onAfterInit();
|
|
|
+ await this.pageOperationService.afterServiceReady();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -477,7 +481,8 @@ Crowi.prototype.start = async function() {
|
|
|
// setup Global Error Handlers
|
|
|
this.setupGlobalErrorHandlers();
|
|
|
|
|
|
- this.afterInit();
|
|
|
+ // Execute this asynchronously after the express server is ready so it does not block the ongoing process
|
|
|
+ this.asyncAfterExpressServerReady();
|
|
|
|
|
|
return serverListening;
|
|
|
};
|
|
|
@@ -697,7 +702,6 @@ Crowi.prototype.setupPageService = async function() {
|
|
|
}
|
|
|
if (this.pageOperationService == null) {
|
|
|
this.pageOperationService = new PageOperationService(this);
|
|
|
- // TODO: Remove this code when resuming feature is implemented
|
|
|
await this.pageOperationService.init();
|
|
|
}
|
|
|
};
|