Add settings to enable/disable cursor streamer log
This commit is contained in:
parent
209c34f703
commit
b623f5360e
@ -2,6 +2,9 @@ import { check } from 'meteor/check';
|
||||
import CursorStreamer from '/imports/api/cursor/server/streamer';
|
||||
import Logger from '/imports/startup/server/logger';
|
||||
|
||||
|
||||
const { streamerLog } = Meteor.settings.private.serverLog;
|
||||
|
||||
const CURSOR_PROCCESS_INTERVAL = 30;
|
||||
|
||||
let cursorQueue = {};
|
||||
@ -37,7 +40,10 @@ export default function handleCursorUpdate({ header, body }, meetingId) {
|
||||
cursorQueue[meetingId] = {};
|
||||
}
|
||||
|
||||
Logger.debug('CursorUpdate process', { cursorReceiverIsRunning });
|
||||
if (streamerLog) {
|
||||
Logger.debug(`CursorUpdate process for meeting ${meetingId} is running: ${cursorReceiverIsRunning}`);
|
||||
}
|
||||
|
||||
// overwrite since we dont care about the other positions
|
||||
cursorQueue[meetingId][userId] = body;
|
||||
if (!cursorReceiverIsRunning) proccess();
|
||||
|
@ -1,6 +1,8 @@
|
||||
import Logger from '/imports/startup/server/logger';
|
||||
import publishCursorUpdate from './methods/publishCursorUpdate';
|
||||
|
||||
const { streamerLog } = Meteor.settings.private.serverLog;
|
||||
|
||||
export function removeCursorStreamer(meetingId) {
|
||||
Logger.info(`Removing Cursor streamer object for meeting ${meetingId}`);
|
||||
delete Meteor.StreamerCentral.instances[`cursor-${meetingId}`];
|
||||
@ -8,12 +10,14 @@ export function removeCursorStreamer(meetingId) {
|
||||
|
||||
export function addCursorStreamer(meetingId) {
|
||||
const streamer = new Meteor.Streamer(`cursor-${meetingId}`, { retransmit: false });
|
||||
|
||||
Logger.debug(`Cursor streamer created for meeting ${meetingId}`);
|
||||
if (streamerLog) {
|
||||
Logger.debug(`Cursor streamer created for meeting ${meetingId}`);
|
||||
}
|
||||
|
||||
streamer.allowRead(function allowRead() {
|
||||
Logger.debug(`Cursor streamer called allowRead for user ${this.userId} in meeting ${meetingId}`);
|
||||
|
||||
if (streamerLog) {
|
||||
Logger.debug(`Cursor streamer called allowRead for user ${this.userId} in meeting ${meetingId}`);
|
||||
}
|
||||
return this.userId && this.userId.includes(meetingId);
|
||||
});
|
||||
|
||||
|
@ -338,6 +338,7 @@ private:
|
||||
- DoLatencyTracerMsg
|
||||
serverLog:
|
||||
level: info
|
||||
streamerLog: false
|
||||
memoryMonitoring:
|
||||
stat:
|
||||
enabled: false
|
||||
|
Loading…
Reference in New Issue
Block a user