move startup logic to platform.js
This commit is contained in:
+3
-6
@@ -6,14 +6,13 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
cloudron = require('./cloudron.js'),
|
||||
constants = require('./constants.js'),
|
||||
database = require('./database.js'),
|
||||
debug = require('debug')('box:server'),
|
||||
eventlog = require('./eventlog.js'),
|
||||
express = require('express'),
|
||||
http = require('http'),
|
||||
middleware = require('./middleware'),
|
||||
platform = require('./platform.js'),
|
||||
routes = require('./routes/index.js'),
|
||||
safe = require('safetydance'),
|
||||
users = require('./users.js'),
|
||||
@@ -460,8 +459,7 @@ async function start() {
|
||||
debug(` Cloudron ${constants.VERSION} `);
|
||||
debug('==========================================');
|
||||
|
||||
await database.initialize();
|
||||
await cloudron.initialize();
|
||||
await platform.initialize();
|
||||
|
||||
gHttpServer = await initializeExpressSync();
|
||||
|
||||
@@ -472,8 +470,7 @@ async function start() {
|
||||
async function stop() {
|
||||
if (!gHttpServer) return;
|
||||
|
||||
await cloudron.uninitialize();
|
||||
await database.uninitialize();
|
||||
await platform.uninitialize();
|
||||
await util.promisify(gHttpServer.close.bind(gHttpServer))();
|
||||
|
||||
gHttpServer = null;
|
||||
|
||||
Reference in New Issue
Block a user