- format spaces to tabs
This commit is contained in:
parent
82bd5e4a6f
commit
61d9223a70
@ -25,56 +25,56 @@ require 'fileutils'
|
||||
|
||||
|
||||
def keep_events_from_non_recorded_meeting(recording_dir, ended_done_file)
|
||||
ended_done_base = File.basename(ended_done_file, '.done')
|
||||
meeting_id = nil
|
||||
break_timestamp = nil
|
||||
|
||||
if match = /^([0-9a-f]+-[0-9]+)$/.match(ended_done_base)
|
||||
meeting_id = match[1]
|
||||
elsif match = /^([0-9a-f]+-[0-9]+)-([0-9]+)$/.match(ended_done_base)
|
||||
meeting_id = match[1]
|
||||
break_timestamp = match[2]
|
||||
else
|
||||
BigBlueButton.logger.warn("Ended done file for #{ended_done_base} has invalid format")
|
||||
end
|
||||
ended_done_base = File.basename(ended_done_file, '.done')
|
||||
meeting_id = nil
|
||||
break_timestamp = nil
|
||||
|
||||
if match = /^([0-9a-f]+-[0-9]+)$/.match(ended_done_base)
|
||||
meeting_id = match[1]
|
||||
elsif match = /^([0-9a-f]+-[0-9]+)-([0-9]+)$/.match(ended_done_base)
|
||||
meeting_id = match[1]
|
||||
break_timestamp = match[2]
|
||||
else
|
||||
BigBlueButton.logger.warn("Ended done file for #{ended_done_base} has invalid format")
|
||||
end
|
||||
|
||||
if meeting_id != nil
|
||||
if !break_timestamp.nil?
|
||||
ret = BigBlueButton.exec_ret("ruby", "events/events.rb", "-m", meeting_id, '-b', break_timestamp)
|
||||
else
|
||||
ret = BigBlueButton.exec_ret("ruby", "events/events.rb", "-m", meeting_id)
|
||||
end
|
||||
end
|
||||
if meeting_id != nil
|
||||
if !break_timestamp.nil?
|
||||
ret = BigBlueButton.exec_ret("ruby", "events/events.rb", "-m", meeting_id, '-b', break_timestamp)
|
||||
else
|
||||
ret = BigBlueButton.exec_ret("ruby", "events/events.rb", "-m", meeting_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
props = YAML::load(File.open('bigbluebutton.yml'))
|
||||
redis_host = props['redis_host']
|
||||
redis_port = props['redis_port']
|
||||
redis_password = props['redis_password']
|
||||
BigBlueButton.redis_publisher = BigBlueButton::RedisWrapper.new(redis_host, redis_port, redis_password)
|
||||
props = YAML::load(File.open('bigbluebutton.yml'))
|
||||
redis_host = props['redis_host']
|
||||
redis_port = props['redis_port']
|
||||
redis_password = props['redis_password']
|
||||
BigBlueButton.redis_publisher = BigBlueButton::RedisWrapper.new(redis_host, redis_port, redis_password)
|
||||
|
||||
log_dir = props['log_dir']
|
||||
recording_dir = props['recording_dir']
|
||||
log_dir = props['log_dir']
|
||||
recording_dir = props['recording_dir']
|
||||
raw_archive_dir = "#{recording_dir}/raw"
|
||||
events_dir = props['events_dir']
|
||||
|
||||
logger = Logger.new("#{log_dir}/bbb-rap-worker.log")
|
||||
#logger = Logger.new(STDOUT)
|
||||
logger.level = Logger::INFO
|
||||
BigBlueButton.logger = logger
|
||||
logger = Logger.new("#{log_dir}/bbb-rap-worker.log")
|
||||
#logger = Logger.new(STDOUT)
|
||||
logger.level = Logger::INFO
|
||||
BigBlueButton.logger = logger
|
||||
|
||||
BigBlueButton.logger.info("Running rap-events-worker...")
|
||||
ended_done_files = Dir.glob("#{recording_dir}/status/ended/*.done")
|
||||
ended_done_files.each do |ended_done|
|
||||
ended_done_base = File.basename(ended_done, '.done')
|
||||
keep_events_from_non_recorded_meeting(recording_dir, ended_done)
|
||||
end
|
||||
BigBlueButton.logger.debug("rap-events-worker done")
|
||||
BigBlueButton.logger.info("Running rap-events-worker...")
|
||||
ended_done_files = Dir.glob("#{recording_dir}/status/ended/*.done")
|
||||
ended_done_files.each do |ended_done|
|
||||
ended_done_base = File.basename(ended_done, '.done')
|
||||
keep_events_from_non_recorded_meeting(recording_dir, ended_done)
|
||||
end
|
||||
BigBlueButton.logger.debug("rap-events-worker done")
|
||||
|
||||
rescue Exception => e
|
||||
BigBlueButton.logger.error(e.message)
|
||||
e.backtrace.each do |traceline|
|
||||
BigBlueButton.logger.error(traceline)
|
||||
end
|
||||
BigBlueButton.logger.error(e.message)
|
||||
e.backtrace.each do |traceline|
|
||||
BigBlueButton.logger.error(traceline)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user