Skip to content
Snippets Groups Projects
Commit 61bc90af authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Be more specific since it's not needed to be generic now,

parent 7351c269
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -91,12 +91,14 @@ module Gitlab
builds = pipeline.builds.latest.
where(status: status).where.not(started_at: nil).order(:started_at)
 
from_builds(builds, :started_at, :finished_at)
from_builds(builds)
end
 
def from_builds(builds, from, to, now = Time.now)
def from_builds(builds)
now = Time.now
periods = builds.map do |b|
Period.new(b.public_send(from) || now, b.public_send(to) || now)
Period.new(b.started_at, b.finished_at || now)
end
 
from_periods(periods)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment