Skip to content

Commit

Permalink
Issue #14 [BuildQueue] fixed get_eta
Browse files Browse the repository at this point in the history
  • Loading branch information
arangamani committed Jan 27, 2013
1 parent 9226519 commit 53bf5c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/jenkins_api_client/build_queue.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012 Kannan Manickam <[email protected]>
# Copyright (c) 2013 Kannan Manickam <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -108,9 +108,8 @@ def get_eta(task_name)
eta = nil
details = get_details(task_name)
unless details.empty?
eta = Time.now - Time.at(
details["buildableStartMilliseconds"].to_i/1000
) if details["buildableStartMilliseconds"]
matched = details["why"].match(/.*\(ETA:(.*)\)/)
eta = matched[1].strip unless matched.nil?
end
eta
end
Expand Down

0 comments on commit 53bf5c9

Please sign in to comment.