Работа над BookUpdateChecker

This commit is contained in:
Book Pauk
2022-07-26 18:43:42 +07:00
parent e6008b5ec4
commit 2c47b2bee3
6 changed files with 158 additions and 13 deletions

View File

@@ -13,6 +13,7 @@ class BookUpdateCheckerController {
this.config = config;
this.isDevelopment = (config.branch == 'development');
this.accessToken = config.accessToken;
this.bucServer = new BUCServer(config);
this.wss = wss;
@@ -57,6 +58,9 @@ class BookUpdateCheckerController {
//pong for WebSocketConnection
this.send({_rok: 1}, req, ws);
if (req.accessToken !== this.accessToken)
throw new Error('Access denied');
switch (req.action) {
case 'test':
await this.test(req, ws); break;