Sha256: add0691244e987559bf9519195602af1559678ae95ec374ffb6afb01d8b36ad0

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

# TODO: This worker exists only because we don't have yet a way to figure out
# precisely when a recording is done processing. Ideally the web conference
# server would send us a request notifying that the recording is ready.
# For now, this worker is used to get all recordings of a room after a meeting
# is ended in the room. It keeps trying a few times even if a recording was
# already found, which is important in case there are multiple playback formats
# that are processed individually (e.g. the first time the recording is found it
# might have only one of the formats done).

# A resque worker to get the recordings of a room.
class BigbluebuttonRecordingsForRoomWorker
  @queue = :bigbluebutton_rails

  def self.perform(room_id, tries_left=0)
    Rails.logger.info "BigbluebuttonRecordingsForRoomWorker worker running"

    room = BigbluebuttonRoom.find(room_id)
    if room.present?
      Rails.logger.info "BigbluebuttonRecordingsForRoomWorker getting recordings for #{room.inspect}"
      room.fetch_recordings( state: BigbluebuttonRecording::STATES.values)

      if tries_left > 0
        Resque.enqueue_in(5.minutes, ::BigbluebuttonRecordingsForRoomWorker, room_id, tries_left - 1)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bigbluebutton_rails-3.0.0 app/workers/bigbluebutton_recordings_for_room_worker.rb