Работа над RemoteLib

This commit is contained in:
Book Pauk
2022-10-07 19:06:00 +07:00
parent e6dfe4d221
commit a82392197f
6 changed files with 181 additions and 17 deletions

View File

@@ -6,13 +6,10 @@ const compression = require('compression');
const http = require('http');
const WebSocket = require ('ws');
const RemoteLib = require('./core/RemoteLib');//singleton
const utils = require('./core/utils');
const ayncExit = new (require('./core/AsyncExit'))();
const maxPayloadSize = 50;//in MB
let log;
let config;
let argv;
@@ -111,8 +108,9 @@ async function init() {
}
}
} else {
const RemoteLib = require('./core/RemoteLib');//singleton
const remoteLib = new RemoteLib(config);
config.inpxFile = await remoteLib.getInpxFile();
config.inpxFile = await remoteLib.downloadInpxFile();
}
config.recreateDb = argv.recreate || false;
@@ -127,7 +125,7 @@ async function main() {
const app = express();
const server = http.createServer(app);
const wss = new WebSocket.Server({ server, maxPayload: maxPayloadSize*1024*1024 });
const wss = new WebSocket.Server({ server, maxPayload: config.maxPayloadSize*1024*1024 });
let devModule = undefined;
if (branch == 'development') {
@@ -137,7 +135,7 @@ async function main() {
}
app.use(compression({ level: 1 }));
//app.use(express.json({limit: `${maxPayloadSize}mb`}));
//app.use(express.json({limit: `${config.maxPayloadSize}mb`}));
if (devModule)
devModule.logQueries(app);