* working out more issues with VRFS-801

This commit is contained in:
Seth Call 2014-01-11 05:23:29 +00:00
parent f5a271c35b
commit eb7adbd303
4 changed files with 24 additions and 5 deletions

View File

@ -57,10 +57,10 @@ module JamRuby
filename = file[:filename]
if filename.start_with? "http"
# fetch it from wherever, put it somewhere on disk, and replace filename in the file parameter with the local disk one
download_filename = Dir::Tmpname.make_tmpname(["#{Dir.tmpdir}audiomixer-file", '.ogg'], nil)
download_filename = Dir::Tmpname.make_tmpname(["#{Dir.tmpdir}/audiomixer-file", '.ogg'], nil)
uri = URI(filename)
open download_filename, 'w' do |io|
open download_filename, 'wb' do |io|
begin
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri
@ -103,7 +103,7 @@ module JamRuby
# write the manifest object to file, to pass into audiomixer
def prepare_manifest
@manifest_file = Dir::Tmpname.make_tmpname( ["#{Dir.tmpdir}audiomixer-manifest-#{@manifest['recording_id']}", '.json'], nil)
@manifest_file = Dir::Tmpname.make_tmpname( ["#{Dir.tmpdir}/audiomixer-manifest-#{@manifest['recording_id']}", '.json'], nil)
File.open(@manifest_file,"w") do |f|
f.write(@manifest.to_json)
end
@ -113,7 +113,7 @@ module JamRuby
# make a suitable location to store the output mix, and pass the chosen filepath into the manifest
def prepare_output
@output_filename = Dir::Tmpname.make_tmpname( ["#{Dir.tmpdir}audiomixer-output-#{@manifest['recording_id']}", '.ogg'], nil)
@output_filename = Dir::Tmpname.make_tmpname( ["#{Dir.tmpdir}/audiomixer-output-#{@manifest['recording_id']}", '.ogg'], nil)
# update manifest so that audiomixer writes here
@manifest[:output][:filename] = @output_filename
@ -123,7 +123,7 @@ module JamRuby
# make a suitable location to store an output error file, which will be populated on failure to help diagnose problems.
def prepare_error_out
@error_out_filename = Dir::Tmpname.make_tmpname( ["#{Dir.tmpdir}audiomixer-error-out-#{@manifest['recording_id']}", '.ogg'], nil)
@error_out_filename = Dir::Tmpname.make_tmpname( ["#{Dir.tmpdir}/audiomixer-error-out-#{@manifest['recording_id']}", '.ogg'], nil)
# update manifest so that audiomixer writes here
@manifest[:error_out] = @error_out_filename
@ -233,6 +233,7 @@ module JamRuby
error_msg = "audiomixer job failed status=#{$?} error_reason=#{error_reason} error_detail=#{error_detail}"
@@log.info(error_msg)
@error_reason = "unable-find-appmixer"
@error_detail = APP_CONFIG.audiomixer_path
raise error_msg
end
rescue Exception => e

View File

@ -165,5 +165,7 @@ include JamRuby
config.ga_suppress_admin = true
config.redis_host = "localhost:6379"
config.audiomixer_path = "/var/lib/audiomixer/audiomixer/audiomixerapp"
end
end

View File

@ -5,5 +5,7 @@ Mime::Type.register "audio/ogg", :audio_ogg
APP_CONFIG = Rails.application.config
puts APP_CONFIG.audiomixer_path
# Initialize the rails application
SampleApp::Application.initialize!

View File

@ -1,3 +1,15 @@
def audiomixer_workspace_path
if ENV['WORKSPACE']
dev_path = ENV['WORKSPACE']
else
dev_path = ENV['HOME'] + '/workspace'
end
dev_path = "#{dev_path}/audiomixer/audiomixer/audiomixerapp"
dev_path if File.exist? dev_path
end
SampleApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
@ -58,4 +70,6 @@ SampleApp::Application.configure do
config.websocket_gateway_connect_time_stale = 16
config.websocket_gateway_connect_time_expire = 26
config.audiomixer_path = ENV['AUDIOMIXER_PATH'] || audiomixer_workspace_path || "/var/lib/audiomixer/audiomixer/audiomixerapp"
end