bigbluebutton-Github/bigbluebutton-html5/imports/api/connection-status/server/modifiers/clearConnectionStatus.js

27 lines
697 B
JavaScript
Raw Normal View History

2020-04-10 01:01:46 +08:00
import ConnectionStatus from '/imports/api/connection-status';
import Logger from '/imports/startup/server/logger';
export default async function clearConnectionStatus(meetingId) {
const selector = {};
2020-04-10 01:01:46 +08:00
if (meetingId) {
selector.meetingId = meetingId;
2020-04-10 01:01:46 +08:00
}
try {
const numberAffected = await ConnectionStatus.removeAsync(selector);
if (numberAffected) {
if (meetingId) {
Logger.info(`Removed ConnectionStatus (${meetingId})`);
} else {
Logger.info('Removed ConnectionStatus (all)');
}
} else {
Logger.warn('Removing ConnectionStatus nonaffected');
}
} catch (err) {
Logger.error(`Removing ConnectionStatus: ${err}`);
}
2020-04-10 01:01:46 +08:00
}