From 233d836ec8fbbdb1dbb639c56778c0501362f4ee Mon Sep 17 00:00:00 2001 From: Ahmad Farhat Date: Mon, 20 Nov 2023 11:43:32 -0500 Subject: [PATCH] Fix issue with recordings resync when no recordings are returned (#5538) --- lib/tasks/server_recordings_sync.rake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/tasks/server_recordings_sync.rake b/lib/tasks/server_recordings_sync.rake index c74260742d..5046b5ebac 100644 --- a/lib/tasks/server_recordings_sync.rake +++ b/lib/tasks/server_recordings_sync.rake @@ -26,6 +26,8 @@ task :server_recordings_sync, %i[provider] => :environment do |_task, args| recordings = BigBlueButtonApi.new(provider: args[:provider]).get_recordings(meeting_ids:) + next if recordings[:recordings].blank? + # Skip the entire batch if the first and last recordings exist if Recording.exists?(record_id: recordings[:recordings][0][:recordID]) && Recording.exists?(record_id: recordings[:recordings][-1][:recordID]) next