🎈 perf(dispatch): 路由使用redis

This commit is contained in:
luying
2023-04-26 09:54:55 +08:00
parent 6907275ff2
commit e1d2b4b349
13 changed files with 67 additions and 154 deletions

View File

@@ -1,7 +1,8 @@
import { STATUS } from './../../../consts/statusCode';
import { dispatch } from '../../../util/dispatcher';
import { dispatch } from '../../../pubUtils/dispatcher';
import { Application, BackendSession, HandlerService, pinus, } from 'pinus';
import { resResult } from '../../../pubUtils/util';
import { redisClient } from '../../../services/redisService';
export default function (app: Application) {
new HandlerService(app, {});
@@ -31,7 +32,7 @@ export class GateHandler {
return resResult(STATUS.CONNECTOR_ERR);
}
// select connector
let res = dispatch(userCode, connectors, 'connector');
let res = await dispatch(redisClient(), userCode, connectors, 'connector');
return resResult(STATUS.SUCCESS, { host: res.clientHost, port: res.clientPort });
}
}