bigbluebutton-Github/bigbluebutton-html5/imports/api/meetings/server/modifiers/clearExternalVideoMeeting.js

27 lines
844 B
JavaScript
Raw Normal View History

import { ExternalVideoMeetings } from '/imports/api/meetings';
import Logger from '/imports/startup/server/logger';
export default async function clearExternalVideoMeeting(meetingId) {
if (meetingId) {
try {
const numberAffected = await ExternalVideoMeetings.removeAsync({ meetingId });
if (numberAffected) {
Logger.info(`Cleared ExternalVideoMeetings in (${meetingId})`);
}
} catch (err) {
Logger.info(`Error on clearing ExternalVideoMeetings in (${meetingId}). ${err}`);
}
} else {
try {
const numberAffected = await ExternalVideoMeetings.removeAsync({});
if (numberAffected) {
Logger.info('Cleared ExternalVideoMeetings in all meetings');
}
} catch (err) {
Logger.error(`Error on clearing ExternalVideoMeetings in all meetings. ${err}`);
}
}
}