use of de.lightbolt.meeting.systems.meeting.dao.MeetingRepository in project LightboltMeeting by LightboltMeeting.
the class MeetingStartJob method execute.
@Override
public void execute(JobExecutionContext context) {
String[] jobDetail = context.getJobDetail().getKey().getName().split("-");
DbHelper.doDaoAction(MeetingRepository::new, dao -> {
Optional<Meeting> meetingOptional = dao.getById(Integer.parseInt(jobDetail[0]));
if (meetingOptional.isEmpty()) {
log.warn("Meeting doesn't exist, cannot execute start job.");
return;
}
Meeting meeting = meetingOptional.get();
if (meeting.getStatus() != MeetingStatus.ONGOING) {
var manager = new MeetingManager(Bot.jda, meeting);
manager.startMeeting();
}
});
}
Aggregations