Skip to content

Commit

Permalink
Merge pull request #1328 from mlibrary/DEEPBLUE-147-globus-dashboard-10
Browse files Browse the repository at this point in the history
DEEPBLUE-147 - Globus dashboard - 10
  • Loading branch information
fritzfreiheit authored Nov 3, 2022
2 parents 894e985 + 796e552 commit 907b8b5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
7 changes: 6 additions & 1 deletion app/jobs/globus_copy_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ class GlobusCopyJob < GlobusJob
# @param [boolean, false] generate_error
# @param [integer, 0 ] delay_per_file_seconds
# @param [String, nil ] user_email
def perform( concern_id, log_prefix: "Globus: ", generate_error: false, delay_per_file_seconds: 0, user_email: nil )
def perform( concern_id,
log_prefix: "Globus: ",
generate_error: ::Deepblue::GlobusIntegrationService.globus_default_generate_error_on_copy,
delay_per_file_seconds: ::Deepblue::GlobusIntegrationService.globus_default_delay_per_file_seconds_on_copy,
user_email: nil )

globus_job_perform( concern_id: concern_id, email: user_email, log_prefix: "#{log_prefix}globus_copy_job" ) do
::Deepblue::LoggingHelper.debug "#{@globus_log_prefix} begin copy" unless @globus_job_quiet
GlobusJob.error_file_delete @globus_concern_id
Expand Down
3 changes: 3 additions & 0 deletions app/services/deepblue/globus_integration_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def self.setup
::Deepblue::InitializationConstants::PREP )
mattr_accessor :globus_restart_all_copy_jobs_quiet, default: true

mattr_accessor :globus_default_generate_error_on_copy, default: false
mattr_accessor :globus_default_delay_per_file_seconds_on_copy, default: 0

def self.globus_int_srv()
puts "globus_int_srv"
end
Expand Down
12 changes: 7 additions & 5 deletions app/services/deepblue/globus_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.get_du( path: )
cmd = "du -sh #{path}"
rv = `#{cmd}`
rv = Array( rv.chomp.split( "\t" ) )
rv << 'N/A' if rv.size < 2
rv.unshift( 'N/A' ) if rv.size < 2 # prepend
rv
end

Expand Down Expand Up @@ -133,18 +133,20 @@ def self.globus_locked?( concern_id, log_prefix: '', quiet: true )

def self.globus_prep_dir_du( concern_id: )
dir = globus_target_prep_dir( concern_id )
return get_du( path: dir ) if File.exist? dir
return get_du( path: dir ).first if File.exist? dir
dir = globus_target_prep_dir( concern_id, prefix: nil )
get_du( path: dir ).first
rv = get_du( path: dir ).first
# get_du2( paths: [globus_target_prep_dir( concern_id ), globus_target_prep_dir( concern_id, prefix: nil )] )
rv
end

def self.globus_prep_tmp_dir_du( concern_id: )
dir = globus_target_prep_tmp_dir( concern_id )
return get_du( path: dir ) if File.exist? dir
return get_du( path: dir ).first if File.exist? dir
dir = globus_target_prep_tmp_dir( concern_id, prefix: nil )
get_du( path: dir ).first
rv = get_du( path: dir ).first
# get_du2( paths: [globus_target_prep_tmp_dir( concern_id ), globus_target_prep_tmp_dir( concern_id, prefix: nil )] )
rv
end

def self.globus_read_token( token_file )
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/globus_service_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
config.globus_dashboard_display_report = false
# config.globus_debug_delay_per_file_copy_job_seconds = 30
config.globus_dashboard_controller_debug_verbose = false

config.globus_default_generate_error_on_copy = false
config.globus_default_delay_per_file_seconds_on_copy = 0
else
config.globus_dashboard_display_all_works = false
config.globus_dashboard_display_report = false
Expand Down

0 comments on commit 907b8b5

Please sign in to comment.