master #1

Merged
lino.jorzick merged 203 commits from External/greenlight:master into master 2021-10-02 18:19:43 +00:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 1f2ef10da6 - Show all commits

View File

@ -90,7 +90,8 @@ module Populator
# Returns exactly 1 page of the latest recordings # Returns exactly 1 page of the latest recordings
def latest_recordings def latest_recordings
return_length = Rails.configuration.pagination_number return_length = Rails.configuration.pagination_rows
number_of_rooms = Rails.configuration.pagination_number
recordings = [] recordings = []
counter = 0 counter = 0
@ -100,8 +101,8 @@ module Populator
Room.includes(:owner) Room.includes(:owner)
.where(users: { provider: @user_domain }) .where(users: { provider: @user_domain })
.order(last_session: :desc) .order(last_session: :desc)
.limit(return_length) .limit(number_of_rooms)
.offset(counter * return_length) .offset(counter * number_of_rooms)
.pluck(:bbb_id) .pluck(:bbb_id)
else else
Room.order(last_session: :desc) Room.order(last_session: :desc)

View File

@ -37,7 +37,7 @@ module Recorder
def all_recordings(room_bbb_ids, search_params = {}, ret_search_params = false, search_name = false) def all_recordings(room_bbb_ids, search_params = {}, ret_search_params = false, search_name = false)
res = { recordings: [] } res = { recordings: [] }
until room_bbb_ids.empty? || res[:recordings].length > Rails.configuration.pagination_number until room_bbb_ids.empty?
# bbb.get_recordings returns an object # bbb.get_recordings returns an object
# take only the array portion of the object that is returned # take only the array portion of the object that is returned
full_res = get_multiple_recordings(room_bbb_ids.pop(Rails.configuration.pagination_number)) full_res = get_multiple_recordings(room_bbb_ids.pop(Rails.configuration.pagination_number))