forked from External/greenlight
fix recording delete not sending notification
This commit is contained in:
parent
059a56e5a6
commit
a72656465b
|
@ -249,7 +249,7 @@ class @Recordings
|
||||||
url: url+'/'+id,
|
url: url+'/'+id,
|
||||||
data: data
|
data: data
|
||||||
}).done((data) ->
|
}).done((data) ->
|
||||||
|
btn.prop('disabled', false)
|
||||||
).fail((data) ->
|
).fail((data) ->
|
||||||
btn.prop('disabled', false)
|
btn.prop('disabled', false)
|
||||||
)
|
)
|
||||||
|
@ -264,7 +264,7 @@ class @Recordings
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: url+'/'+id
|
url: url+'/'+id
|
||||||
}).done((data) ->
|
}).done((data) ->
|
||||||
|
btn.prop('disabled', false)
|
||||||
).fail((data) ->
|
).fail((data) ->
|
||||||
btn.prop('disabled', false)
|
btn.prop('disabled', false)
|
||||||
)
|
)
|
||||||
|
|
|
@ -159,9 +159,10 @@ class BbbController < ApplicationController
|
||||||
# DELETE /rooms/:id/recordings/:record_id
|
# DELETE /rooms/:id/recordings/:record_id
|
||||||
# DELETE /rooms/:room_id/:id/recordings/:record_id
|
# DELETE /rooms/:room_id/:id/recordings/:record_id
|
||||||
def delete_recordings
|
def delete_recordings
|
||||||
|
recording = bbb_get_recordings({recordID: params[:record_id]})[:recordings].first
|
||||||
bbb_res = bbb_delete_recordings(params[:record_id])
|
bbb_res = bbb_delete_recordings(params[:record_id])
|
||||||
if bbb_res[:returncode]
|
if bbb_res[:returncode]
|
||||||
RecordingDeletesJob.perform_later(@user.encrypted_id, params[:record_id], params[:id])
|
RecordingDeletesJob.perform_later(@user.encrypted_id, params[:record_id], recording[:metadata][:"meeting-name"])
|
||||||
end
|
end
|
||||||
render_bbb_response bbb_res
|
render_bbb_response bbb_res
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,25 +20,12 @@ class RecordingDeletesJob < ApplicationJob
|
||||||
queue_as :default
|
queue_as :default
|
||||||
|
|
||||||
def perform(room, record_id, meeting=nil)
|
def perform(room, record_id, meeting=nil)
|
||||||
tries = 0
|
full_id = "#{room}-#{meeting}"
|
||||||
sleep_time = 2
|
ActionCable.server.broadcast "#{room}_recording_updates_channel",
|
||||||
|
action: 'delete',
|
||||||
while tries < 4
|
id: record_id
|
||||||
bbb_res = bbb_get_recordings({recordID: record_id})
|
ActionCable.server.broadcast "#{full_id}_recording_updates_channel",
|
||||||
if !bbb_res[:recordings] || bbb_res[:messageKey] == 'noRecordings'
|
action: 'delete',
|
||||||
full_id = room
|
id: record_id
|
||||||
full_id += "-#{recording[:metadata][:"meeting-name"]}"
|
|
||||||
ActionCable.server.broadcast "#{room}_recording_updates_channel",
|
|
||||||
action: 'delete',
|
|
||||||
id: record_id
|
|
||||||
ActionCable.server.broadcast "#{full_id}_recording_updates_channel",
|
|
||||||
action: 'delete',
|
|
||||||
id: record_id
|
|
||||||
break
|
|
||||||
end
|
|
||||||
sleep sleep_time
|
|
||||||
sleep_time = sleep_time * 2
|
|
||||||
tries += 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue