diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-12 04:12:04 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-30 23:55:08 +0900 |
commit | fbd3b3d8a245072121784df11b7b41d3257b989f (patch) | |
tree | 53fd84be85bd74545d59433b1b5fcf61f5d4910e /app/models/ci/pipeline_schedule.rb | |
parent | a16cbab3bb371941f51c3c4178b8b807de000ca8 (diff) | |
download | gitlab-ce-fbd3b3d8a245072121784df11b7b41d3257b989f.tar.gz |
Add API support for pipeline schedule
Diffstat (limited to 'app/models/ci/pipeline_schedule.rb')
-rw-r--r-- | app/models/ci/pipeline_schedule.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/ci/pipeline_schedule.rb b/app/models/ci/pipeline_schedule.rb index 07213ca608a..58cf62513d3 100644 --- a/app/models/ci/pipeline_schedule.rb +++ b/app/models/ci/pipeline_schedule.rb @@ -40,6 +40,10 @@ module Ci self.next_run_at = Gitlab::Ci::CronParser.new(cron, cron_timezone).next_time_from(Time.now) end + def last_pipeline + self.pipelines&.last + end + def schedule_next_run! save! # with set_next_run_at rescue ActiveRecord::RecordInvalid |