From 25dddd710a67e4e85722bcc82aa0180646daf055 Mon Sep 17 00:00:00 2001
From: MontrealSergiy <sergeboroday@gmail.com>
Date: Mon, 26 Aug 2024 23:53:30 -0400
Subject: [PATCH] Add admin option to enable/disable compression when archiving
 task directories (bugfix) #1123

---
 BrainPortal/app/models/cluster_task.rb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/BrainPortal/app/models/cluster_task.rb b/BrainPortal/app/models/cluster_task.rb
index 113e40a3d..1e3ed8d73 100644
--- a/BrainPortal/app/models/cluster_task.rb
+++ b/BrainPortal/app/models/cluster_task.rb
@@ -1321,7 +1321,7 @@ def in_situ_workdir_archive_file(nozip) #:nodoc:
   # state of the workdir can be performed with
   # unarchive_work_directory().
   def archive_work_directory(nozip = false)
-    self.addlog("archiving, compression  #{nozip}")
+
     # Keep updated_at value in order to reset it at the end of method
     updated_at_value = self.updated_at
 
@@ -1534,10 +1534,9 @@ def unarchive_work_directory
   # Restoring the state of the workdir can be performed
   # with unarchive_work_directory_from_userfile().
   def archive_work_directory_to_userfile(dp_id = nil, nozip = nil)
-    return false unless self.archive_work_directory
+    return false unless self.archive_work_directory(nozip)
     file_id  = self.workdir_archive_userfile_id
     return true if file_id
-
     full=self.full_cluster_workdir
     if ! Dir.exists?(full)
       self.addlog("Cannot archive: work directory '#{full}' does not exist.")