From e7b0e6977a9750aaa67912f74cfccd73b215a07e Mon Sep 17 00:00:00 2001 From: Arthur Rosendahl Date: Wed, 13 Sep 2023 23:01:06 +0200 Subject: [PATCH] Store temporary files in shared Docker volumes; fixes #1581 --- app/controllers/templates_controller.rb | 6 +++--- lib/seek/isa_templates/template_extractor.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 53d070285a..dcb5dace04 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -87,7 +87,7 @@ def task_status def populate_template uploaded_file = params[:template_json_file] - dir = Rails.root.join('config', 'default_data', 'source_types') + dir = Seek::Config.append_filestore_path('source_types') if Dir.exist?(dir) `rm #{dir}/*` @@ -146,11 +146,11 @@ def set_status end def lockfile - Rails.root.join('tmp', 'populate_templates.lock') + Rails.root.join(Seek::Config.temporary_filestore_path, 'populate_templates.lock') end def resultfile - Rails.root.join('tmp', 'populate_templates.result') + Rails.root.join(Seek::Config.temporary_filestore_path, 'populate_templates.result') end def running! diff --git a/lib/seek/isa_templates/template_extractor.rb b/lib/seek/isa_templates/template_extractor.rb index b0487a7e24..236b8d5606 100644 --- a/lib/seek/isa_templates/template_extractor.rb +++ b/lib/seek/isa_templates/template_extractor.rb @@ -12,7 +12,7 @@ def self.extract_templates disable_authorization_checks do client = Ebi::OlsClient.new project = Project.find_or_create_by(title: 'Default Project') - directory = Rails.root.join('config', 'default_data', 'source_types') + directory = Seek::Config.append_filestore_path('source_types') directory_files = Dir.exist?(directory) ? Dir.glob("#{directory}/*.json") : [] raise '' if directory_files == [] @@ -172,11 +172,11 @@ def self.seed_isa_tags end def self.lockfile - Rails.root.join('tmp', 'populate_templates.lock') + Rails.root.join(Seek::Config.temporary_filestore_path, 'populate_templates.lock') end def self.resultfile - Rails.root.join('tmp', 'populate_templates.result') + Rails.root.join(Seek::Config.temporary_filestore_path, 'populate_templates.result') end end end