Skip to content

Commit

Permalink
update submit.yml.erb
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokolt committed Jun 11, 2024
1 parent 484a71e commit 9e33186
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/deploy-data/ood/submit.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@ batch_connect:
%s

script:
# Requesting 2Gb for each file
native: ["--mem", <%= (Dir.glob("#{audio_path}/*").select { |f| File.file?(f) }.count * 2).to_s + "G" %>]

This comment has been minimized.

Copy link
@hsnfirooz

hsnfirooz Jun 13, 2024

Member

I guess this should solve the issue in one line:

["--mem", <%= ((Dir.glob("#{audio_path}/*").select { |f| File.file?(f) }.count + 1) * 2).to_s + "G" %>]

This comment has been minimized.

Copy link
@hsnfirooz

hsnfirooz Jun 13, 2024

Member

Maybe a comment can be nice :D

# Request 2Gb per file
<% if File.directory?(audio_path) %>
native: ["--mem", <%= (Dir.glob("#{audio_path}/*").select { |f| File.file?(f) }.count * 2).to_s + "G" %>]
<% elsif File.file?(audio_path) %>
native: ["--mem", "2G"]
<% else %>
raise "Invalid audio_path: #{audio_path} is neither a file nor a directory."
<% end %>

1 comment on commit 9e33186

@hsnfirooz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can go with if statements, or the one-liner. Either way, looks great :D

Please sign in to comment.