Skip to content

Commit

Permalink
Corrected a mistake in converting duration to seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
mnakao committed Jan 18, 2024
1 parent 3a161c3 commit 9dcdd3c
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 9dcdd3c

Please sign in to comment.