diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-24 00:18:13 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-06 23:46:58 +0900 |
commit | 37d6d1e46130f44f2fe05171b814b5682696839c (patch) | |
tree | 5763dde8262d2d513145eadd70236dbebdba98c1 /app/workers | |
parent | 5f715f1d32c6f5ce25b3721bde8f476173afadc8 (diff) | |
download | gitlab-ce-37d6d1e46130f44f2fe05171b814b5682696839c.tar.gz |
basic components
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/scheduled_trigger_worker.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/workers/scheduled_trigger_worker.rb b/app/workers/scheduled_trigger_worker.rb index 7dc17aa4332..5c2f03dee79 100644 --- a/app/workers/scheduled_trigger_worker.rb +++ b/app/workers/scheduled_trigger_worker.rb @@ -3,15 +3,15 @@ class ScheduledTriggerWorker include CronjobQueue def perform - # TODO: Update next_run_at - - Ci::ScheduledTriggers.where("next_run_at < ?", Time.now).find_each do |trigger| + Ci::ScheduledTrigger.where("next_run_at < ?", Time.now).find_each do |trigger| begin - Ci::CreateTriggerRequestService.new.execute(trigger.project, trigger, trigger.ref) + Ci::CreatePipelineService.new(trigger.project, trigger.owner, ref: trigger.ref). + execute(ignore_skip_ci: true, scheduled_trigger: true) rescue => e Rails.logger.error "#{trigger.id}: Failed to trigger job: #{e.message}" ensure trigger.schedule_next_run! + trigger.update_last_run! end end end |