2021-06-03 02:29:40 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import RedisPubSub from '/imports/startup/server/redis';
|
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
|
2022-02-21 19:14:34 +08:00
|
|
|
export default function setBreakoutsTime({ timeInMinutes }) {
|
2021-06-03 02:29:40 +08:00
|
|
|
const REDIS_CONFIG = Meteor.settings.private.redis;
|
|
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
2022-02-21 19:14:34 +08:00
|
|
|
const EVENT_NAME = 'UpdateBreakoutRoomsTimeReqMsg';
|
2021-06-03 02:29:40 +08:00
|
|
|
|
|
|
|
try {
|
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
|
|
|
|
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
|
|
|
|
2022-02-21 19:14:34 +08:00
|
|
|
RedisPubSub.publishUserMessage(
|
2021-06-03 02:29:40 +08:00
|
|
|
CHANNEL, EVENT_NAME, meetingId, requesterUserId,
|
|
|
|
{
|
|
|
|
meetingId,
|
2022-02-21 19:14:34 +08:00
|
|
|
timeInMinutes,
|
2021-06-03 02:29:40 +08:00
|
|
|
},
|
|
|
|
);
|
|
|
|
} catch (err) {
|
2022-02-21 19:14:34 +08:00
|
|
|
Logger.error(`Exception while invoking method setBreakoutsTime ${err.stack}`);
|
2021-06-03 02:29:40 +08:00
|
|
|
}
|
|
|
|
}
|