diff --git a/bigbluebutton-html5/imports/api/ping-pong/server/publishers.js b/bigbluebutton-html5/imports/api/ping-pong/server/publishers.js index 8963b9ca4892f57ccdaf56fa5490336ae37241d3..972393535e504ce3757c38326dd3a2f8544c96b0 100644 --- a/bigbluebutton-html5/imports/api/ping-pong/server/publishers.js +++ b/bigbluebutton-html5/imports/api/ping-pong/server/publishers.js @@ -3,7 +3,11 @@ import Logger from '/imports/startup/server/logger'; import _ from 'lodash'; const COLLECTION_NAME = 'ping-pong'; -const POLL_INTERVAL = 15000; +const INTERVAL_IN_SETTINGS = (Meteor.settings.public.pingPong.clearUsersInSeconds) * 1000; +const INTERVAL_TIME = INTERVAL_IN_SETTINGS < 10000 ? 10000 : INTERVAL_IN_SETTINGS; +const PONG_INTERVAL_IN_SETTINGS = (Meteor.settings.public.pingPong.pongTimeInSeconds) * 1000; +const PONG_INTERVAL = PONG_INTERVAL_IN_SETTINGS >= (INTERVAL_TIME / 2) + ? (INTERVAL_TIME / 2) : PONG_INTERVAL_IN_SETTINGS; function pingPong(credentials) { const { meetingId, requesterUserId } = credentials; @@ -23,7 +27,7 @@ function pingPong(credentials) { }; pongSender(); this.ready(); - const interval = Meteor.setInterval(() => pongSender(true), POLL_INTERVAL); + const interval = Meteor.setInterval(() => pongSender(true), PONG_INTERVAL); this.onStop(() => { Meteor.clearInterval(interval); diff --git a/bigbluebutton-html5/imports/startup/server/index.js b/bigbluebutton-html5/imports/startup/server/index.js index 45a278725e8e91488fe49355127db7fe5a2c4c06..87254c93ef9a8902e707526eb1275c5bc2ee395e 100755 --- a/bigbluebutton-html5/imports/startup/server/index.js +++ b/bigbluebutton-html5/imports/startup/server/index.js @@ -11,11 +11,13 @@ import setMinBrowserVersions from './minBrowserVersion'; import userLeaving from '/imports/api/users/server/methods/userLeaving'; const parse = Npm.require('url').parse; -const INTERVAL_TIME = 30000; const AVAILABLE_LOCALES = fs.readdirSync('assets/app/locales'); Meteor.startup(() => { + const APP_CONFIG = Meteor.settings.public.app; + const INTERVAL_IN_SETTINGS = (Meteor.settings.public.pingPong.clearUsersInSeconds) * 1000; + const INTERVAL_TIME = INTERVAL_IN_SETTINGS < 10000 ? 10000 : INTERVAL_IN_SETTINGS; const env = Meteor.isDevelopment ? 'development' : 'production'; const CDN_URL = APP_CONFIG.cdn; diff --git a/bigbluebutton-html5/private/config/settings.yml b/bigbluebutton-html5/private/config/settings.yml index 4c4559cd5f153e15065cf92a04e922452bd89b49..77c39d4ec4f4cd7d70b46215c57a6d6157fc5be7 100755 --- a/bigbluebutton-html5/private/config/settings.yml +++ b/bigbluebutton-html5/private/config/settings.yml @@ -142,6 +142,9 @@ public: enableVideoMenu: true enableListenOnly: true autoShareWebcam: false + pingPong: + clearUsersInSeconds: 30 + pongTimeInSeconds: 15 allowOutsideCommands: toggleRecording: false toggleSelfVoice: false