mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
chore: skip parse message when app not found
This commit is contained in:
parent
2eacd69758
commit
ed6d6f9f9a
@ -428,14 +428,17 @@ export class Gateway extends EventEmitter {
|
|||||||
|
|
||||||
this.wsServer.on('message', async ({ client, message }) => {
|
this.wsServer.on('message', async ({ client, message }) => {
|
||||||
const app = await AppSupervisor.getInstance().getApp(client.app);
|
const app = await AppSupervisor.getInstance().getApp(client.app);
|
||||||
|
|
||||||
|
if (!app) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const parsedMessage = JSON.parse(message.toString());
|
const parsedMessage = JSON.parse(message.toString());
|
||||||
|
|
||||||
if (!parsedMessage.type) {
|
if (!parsedMessage.type) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check app has event listener
|
|
||||||
|
|
||||||
if (!app.listenerCount(`ws:setTag`)) {
|
if (!app.listenerCount(`ws:setTag`)) {
|
||||||
app.on('ws:setTag', ({ clientId, tagKey, tagValue }) => {
|
app.on('ws:setTag', ({ clientId, tagKey, tagValue }) => {
|
||||||
this.wsServer.setClientTag(clientId, tagKey, tagValue);
|
this.wsServer.setClientTag(clientId, tagKey, tagValue);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user