From 7d95fd91893ee8792023eaacd6b86c76e05269c3 Mon Sep 17 00:00:00 2001
From: Richard Alam <ritzalam@gmail.com>
Date: Mon, 22 Mar 2021 09:24:02 -0700
Subject: [PATCH]  Keep recording status files

 We still use the recording status files to externally monitor the
 progress of the recordings. Let's keep these files for now until
 we figure out a different way to track the status of the recording.
---
 .../core/lib/recordandplayback/workers/archive_worker.rb  | 7 ++++++-
 .../core/lib/recordandplayback/workers/process_worker.rb  | 7 ++++++-
 .../core/lib/recordandplayback/workers/publish_worker.rb  | 8 +++++++-
 .../core/lib/recordandplayback/workers/sanity_worker.rb   | 7 ++++++-
 4 files changed, 25 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 record-and-playback/core/lib/recordandplayback/workers/archive_worker.rb
 mode change 100644 => 100755 record-and-playback/core/lib/recordandplayback/workers/process_worker.rb
 mode change 100644 => 100755 record-and-playback/core/lib/recordandplayback/workers/publish_worker.rb
 mode change 100644 => 100755 record-and-playback/core/lib/recordandplayback/workers/sanity_worker.rb

diff --git a/record-and-playback/core/lib/recordandplayback/workers/archive_worker.rb b/record-and-playback/core/lib/recordandplayback/workers/archive_worker.rb
old mode 100644
new mode 100755
index 747fbb79e1..9f1058a2de
--- a/record-and-playback/core/lib/recordandplayback/workers/archive_worker.rb
+++ b/record-and-playback/core/lib/recordandplayback/workers/archive_worker.rb
@@ -27,7 +27,12 @@ module BigBlueButton
           @logger.info("Running archive worker for #{@full_id}")
           @publisher.put_archive_started(@meeting_id)
 
-          remove_status_files
+          # Keep the status files so we can still track
+          # the recording progress. We need these at the moment
+          # for the monitoring tools to continue to work.
+          # We need to find a better way (storing in redis?)
+          # in the future to be able to monitor progress.
+          #remove_status_files
 
           script = File.join(BigBlueButton.rap_scripts_path, 'archive', 'archive.rb')
           if @break_timestamp.nil?
diff --git a/record-and-playback/core/lib/recordandplayback/workers/process_worker.rb b/record-and-playback/core/lib/recordandplayback/workers/process_worker.rb
old mode 100644
new mode 100755
index 2f00d9a630..66fb040313
--- a/record-and-playback/core/lib/recordandplayback/workers/process_worker.rb
+++ b/record-and-playback/core/lib/recordandplayback/workers/process_worker.rb
@@ -29,7 +29,12 @@ module BigBlueButton
           script = File.join(BigBlueButton.rap_scripts_path,
                              'process', "#{@format_name}.rb")
           if File.exist?(script)
-            remove_status_files
+            # Keep the status files so we can still track
+            # the recording progress. We need these at the moment
+            # for the monitoring tools to continue to work.
+            # We need to find a better way (storing in redis?)
+            # in the future to be able to monitor progress.
+            #remove_status_files
 
             @publisher.put_process_started(@format_name, @meeting_id)
 
diff --git a/record-and-playback/core/lib/recordandplayback/workers/publish_worker.rb b/record-and-playback/core/lib/recordandplayback/workers/publish_worker.rb
old mode 100644
new mode 100755
index 982e7d61fb..6e658f14ec
--- a/record-and-playback/core/lib/recordandplayback/workers/publish_worker.rb
+++ b/record-and-playback/core/lib/recordandplayback/workers/publish_worker.rb
@@ -35,7 +35,13 @@ module BigBlueButton
 
             # If the publish directory exists, the script does nothing
             FileUtils.rm_rf("#{@recording_dir}/publish/#{@format_name}/#{@full_id}")
-            remove_status_files
+
+            # Keep the status files so we can still track
+            # the recording progress. We need these at the moment
+            # for the monitoring tools to continue to work.
+            # We need to find a better way (storing in redis?)
+            # in the future to be able to monitor progress.
+            #remove_status_files
 
             # For legacy reasons, the meeting ID passed to the publish script contains
             # the playback format name.
diff --git a/record-and-playback/core/lib/recordandplayback/workers/sanity_worker.rb b/record-and-playback/core/lib/recordandplayback/workers/sanity_worker.rb
old mode 100644
new mode 100755
index 16e7e5874c..04544bbfdb
--- a/record-and-playback/core/lib/recordandplayback/workers/sanity_worker.rb
+++ b/record-and-playback/core/lib/recordandplayback/workers/sanity_worker.rb
@@ -27,7 +27,12 @@ module BigBlueButton
           @logger.info("Running sanity worker for #{@full_id}")
           @publisher.put_sanity_started(@meeting_id)
 
-          remove_status_files
+          # Keep the status files so we can still track
+          # the recording progress. We need these at the moment
+          # for the monitoring tools to continue to work.
+          # We need to find a better way (storing in redis?)
+          # in the future to be able to monitor progress.
+          #remove_status_files
 
           script = File.join(BigBlueButton.rap_scripts_path, 'sanity', 'sanity.rb')
           if @break_timestamp.nil?
-- 
GitLab