Class: BigbluebuttonRails::BackgroundTasks
- Inherits:
-
Object
- Object
- BigbluebuttonRails::BackgroundTasks
- Defined in:
- lib/bigbluebutton_rails/background_tasks.rb
Overview
Helper methods to execute tasks that run in resque and rake.
Class Method Summary collapse
-
.finish_meetings ⇒ Object
For each meeting that hasn’t ended yet, call ‘getMeetingInfo` and update the meeting attributes or end it.
- .update_recordings ⇒ Object
Class Method Details
.finish_meetings ⇒ Object
For each meeting that hasn’t ended yet, call ‘getMeetingInfo` and update the meeting attributes or end it.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bigbluebutton_rails/background_tasks.rb', line 8 def self.finish_meetings .where(ended: false).find_each do |meeting| Rails.logger.info "BackgroundTasks: Checking if the meeting has ended: #{meeting.inspect}" room = meeting.room if room.present? #and !meeting.room.fetch_is_running? # `fetch_meeting_info` will automatically update the meeting by # calling `room.update_current_meeting_record` room.fetch_meeting_info end end end |
.update_recordings ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bigbluebutton_rails/background_tasks.rb', line 20 def self.update_recordings .find_each do |server| begin server.fetch_recordings(nil, true) Rails.logger.info "BackgroundTasks: List of recordings from #{server.url} updated successfully" rescue Exception => e Rails.logger.info "BackgroundTasks: Failure fetching recordings from #{server.inspect}" Rails.logger.info "BackgroundTasks: #{e.inspect}" Rails.logger.info "BackgroundTasks: #{e.backtrace.join("\n")}" end end end |