Clear meeting-time-remaining collection

This commit is contained in:
Anton Georgiev 2021-02-05 21:42:52 +00:00 committed by Joao Siebel
parent 811d6d3f98
commit 3d78045363
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,26 @@
import { MeetingTimeRemaining } from '/imports/api/meetings';
import Logger from '/imports/startup/server/logger';
export default function clearMeetingTimeRemaining(meetingId) {
if (meetingId) {
try {
const numberAffected = MeetingTimeRemaining.remove({ meetingId });
if (numberAffected) {
Logger.info(`Cleared MeetingTimeRemaining in (${meetingId})`);
}
} catch (err) {
Logger.info(`Error on clearing MeetingTimeRemaining in (${meetingId}). ${err}`);
}
} else {
try {
const numberAffected = MeetingTimeRemaining.remove({});
if (numberAffected) {
Logger.info('Cleared MeetingTimeRemaining in all meetings');
}
} catch (err) {
Logger.error(`Error on clearing MeetingTimeRemaining in all meetings. ${err}`);
}
}
}

View File

@ -20,6 +20,7 @@ import clearUserInfo from '/imports/api/users-infos/server/modifiers/clearUserIn
import clearConnectionStatus from '/imports/api/connection-status/server/modifiers/clearConnectionStatus';
import clearNote from '/imports/api/note/server/modifiers/clearNote';
import clearNetworkInformation from '/imports/api/network-information/server/modifiers/clearNetworkInformation';
import clearMeetingTimeRemaining from '/imports/api/meetings/server/modifiers/clearMeetingTimeRemaining';
import clearLocalSettings from '/imports/api/local-settings/server/modifiers/clearLocalSettings';
import clearRecordMeeting from './clearRecordMeeting';
import clearVoiceCallStates from '/imports/api/voice-call-states/server/modifiers/clearVoiceCallStates';
@ -49,6 +50,7 @@ export default function meetingHasEnded(meetingId) {
clearNote(meetingId);
clearNetworkInformation(meetingId);
clearLocalSettings(meetingId);
clearMeetingTimeRemaining(meetingId);
clearRecordMeeting(meetingId);
clearVoiceCallStates(meetingId);
clearVideoStreams(meetingId);