diff --git a/record-and-playback/core/scripts/rap-process-worker.rb b/record-and-playback/core/scripts/rap-process-worker.rb index 4f062b9f8d..535ec6c5bd 100755 --- a/record-and-playback/core/scripts/rap-process-worker.rb +++ b/record-and-playback/core/scripts/rap-process-worker.rb @@ -22,8 +22,9 @@ require '../lib/recordandplayback' require 'rubygems' require 'yaml' require 'fileutils' +require 'optparse' -def process_archived_meetings(recording_dir) +def process_archived_meetings(recording_dir, pattern) sanity_done_files = Dir.glob("#{recording_dir}/status/sanity/*.done") FileUtils.mkdir_p("#{recording_dir}/status/processed") @@ -43,6 +44,12 @@ def process_archived_meetings(recording_dir) next end + unless pattern.nil? + next unless pattern.match(done_base) + + BigBlueButton.logger.info("Processing #{done_base} because it matched the pattern #{pattern.inspect}") + end + step_succeeded = true # Generate captions @@ -151,9 +158,18 @@ begin logger.level = Logger::INFO BigBlueButton.logger = logger - BigBlueButton.logger.debug("Running rap-process-worker...") - - process_archived_meetings(recording_dir) + options = { pattern: nil } + OptionParser.new do |opt| + opt.on('-p PATTERN') { |o| options[:pattern] = o } + end.parse! + pattern = Regexp.new(options[:pattern]) unless options[:pattern].nil? + + if pattern.nil? + BigBlueButton.logger.debug("Running rap-process-worker...") + else + BigBlueButton.logger.debug("Running rap-process-worker with pattern #{pattern.inspect}...") + end + process_archived_meetings(recording_dir, pattern) BigBlueButton.logger.debug("rap-process-worker done")