Class: BigbluebuttonRecordingsForRoomWorker

Inherits:
Object
  • Object
show all
Defined in:
app/workers/bigbluebutton_recordings_for_room_worker.rb

Overview

A resque worker to get the recordings of a room.

Class Method Summary collapse

Class Method Details

.perform(room_id, tries_left = 0) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/workers/bigbluebutton_recordings_for_room_worker.rb', line 14

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

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