Skip to content

Commit

Permalink
Apply hideServerInfo to streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 committed Feb 19, 2024
1 parent e165b7b commit 40bc165
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/api/stream/channels/server-stats.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import autobind from 'autobind-decorator';
import Xev from 'xev';
import Channel from '../channel';
import config from '../../../../config';

const ev = new Xev();

Expand All @@ -11,16 +12,19 @@ export default class extends Channel {

@autobind
public async init(params: any) {
if (config.hideServerInfo) return;
ev.addListener('serverStats', this.onStats);
}

@autobind
private onStats(stats: any) {
if (config.hideServerInfo) return;
this.send('stats', stats);
}

@autobind
public onMessage(type: string, body: any) {
if (config.hideServerInfo) return;
switch (type) {
case 'requestLog':
ev.once(`serverStatsLog:${body.id}`, statsLog => {
Expand Down

0 comments on commit 40bc165

Please sign in to comment.