Revert "We don't have to touch it because builds would touch pipeline anyway"

This reverts commit 3691a39152.
This commit is contained in:
Lin Jen-Shin 2016-08-04 01:05:17 +08:00
parent 94b3d33de1
commit 431792f784
2 changed files with 11 additions and 0 deletions

View file

@ -27,6 +27,7 @@ module Ci
end
pipeline.save!
pipeline.touch
unless pipeline.create_builds(current_user)
pipeline.errors.add(:base, 'No builds for this pipeline.')

View file

@ -53,7 +53,17 @@ class CreateCommitBuildsService
return false
end
save_pipeline!
end
private
##
# Create a new pipeline and touch object to calculate status
#
def save_pipeline!
@pipeline.save!
@pipeline.touch
@pipeline
end
end