We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 69226b9 + d832794 commit 452deccCopy full SHA for 452decc
src/status.monitor.gateway.ts
@@ -30,12 +30,14 @@ export class StatusMonitorGateway implements OnGatewayConnection {
30
}
31
32
sendMetrics(metrics) {
33
- const data = {
34
- os: metrics.os[metrics.os.length - 2],
35
- responses: metrics.responses[metrics.responses.length - 2],
36
- interval: metrics.interval,
37
- retention: metrics.retention,
38
- };
39
- this.server.emit('esm_stats', data);
+ if (this.server) {
+ const data = {
+ os: metrics.os[metrics.os.length - 2],
+ responses: metrics.responses[metrics.responses.length - 2],
+ interval: metrics.interval,
+ retention: metrics.retention,
+ };
40
+ this.server.emit('esm_stats', data);
41
+ }
42
43
0 commit comments