diff --git a/config/initializers/triclops.rb b/config/initializers/triclops.rb index d1d1d1c..c2672d4 100644 --- a/config/initializers/triclops.rb +++ b/config/initializers/triclops.rb @@ -42,15 +42,14 @@ def validate_triclops_config! validate_triclops_config! # If temp_directory is not set, default to ruby temp dir - TRICLOPS[:tmp_directory] = Dir.tmpdir if TRICLOPS[:tmp_directory].nil? - + TRICLOPS[:tmp_directory] = Dir.tmpdir if TRICLOPS[:tmp_directory].blank? # Make temp_directory if it does not already exist FileUtils.mkdir_p(TRICLOPS[:tmp_directory]) - # Set the TMPDIR ENV variable so that Vips (via Imogen) writes temp files here. - # This defaults to the OS temp directory if not otherwise set, which can be a - # problem if we're on a host that has limited local disk space. - ENV['TMPDIR'] = TRICLOPS[:tmp_directory] + # If vips_tmp_directory is not set, default to ruby temp dir + TRICLOPS['vips_tmp_directory'] = Dir.tmpdir if TRICLOPS['vips_tmp_directory'].blank? + # Make vips_tmp_directory if it does not already exist + FileUtils.mkdir_p(TRICLOPS['vips_tmp_directory']) end Rails.application.config.active_job.queue_adapter = :inline if TRICLOPS['run_queued_jobs_inline'] diff --git a/config/templates/triclops.template.yml b/config/templates/triclops.template.yml index fd19a94..4f95af0 100644 --- a/config/templates/triclops.template.yml +++ b/config/templates/triclops.template.yml @@ -11,6 +11,7 @@ development: retry_delay: 1 retry_count: 11 tmp_directory: <%= Rails.root.join('tmp', 'triclops_development_tmp') %> + vips_tmp_directory: <%= Rails.root.join('tmp', 'triclops_development_tmp') %> test: run_queued_jobs_inline: true @@ -25,3 +26,4 @@ test: retry_delay: 1 retry_count: 11 tmp_directory: <%= Rails.root.join('tmp', 'triclops_test_tmp') %> + vips_tmp_directory: <%= Rails.root.join('tmp', 'triclops_test_tmp') %>