Skip to content

Commit

Permalink
Corrected a mistake in converting duration to seconds (#823)
Browse files Browse the repository at this point in the history
Corrected a mistake in converting duration to seconds
  • Loading branch information
mnakao authored Jan 18, 2024
1 parent 122835c commit e750a4d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/ood_core/job/adapters/fujitsu_tcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,8 @@ def directive_prefix
# Convert duration to seconds
def duration_in_seconds(time)
return 0 if time.nil? or time == "-"
time, days = time.split("-").reverse
days.to_i * 24 * 3600 +
time.split(':').map { |v| v.to_i }.inject(0) { |total, v| total * 60 + v }
matched = time.match(/\((\d+\))/)
return matched ? matched[1].to_i : 0
end

# Convert seconds to duration
Expand Down

0 comments on commit e750a4d

Please sign in to comment.