Skip to content

Commit e750a4d

Browse files
authored
Corrected a mistake in converting duration to seconds (#823)
Corrected a mistake in converting duration to seconds
1 parent 122835c commit e750a4d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/ood_core/job/adapters/fujitsu_tcs.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,8 @@ def directive_prefix
386386
# Convert duration to seconds
387387
def duration_in_seconds(time)
388388
return 0 if time.nil? or time == "-"
389-
time, days = time.split("-").reverse
390-
days.to_i * 24 * 3600 +
391-
time.split(':').map { |v| v.to_i }.inject(0) { |total, v| total * 60 + v }
389+
matched = time.match(/\((\d+\))/)
390+
return matched ? matched[1].to_i : 0
392391
end
393392

394393
# Convert seconds to duration

0 commit comments

Comments
 (0)