diff options
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index c5ba19438cd..2db606898b9 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -57,6 +57,9 @@ class CommitStatus < ApplicationRecord scope :in_pipelines, ->(pipelines) { where(pipeline: pipelines) } scope :eager_load_pipeline, -> { eager_load(:pipeline, project: { namespace: :route }) } scope :with_pipeline, -> { joins(:pipeline) } + scope :updated_before, ->(lookback:, timeout:) { + where('(ci_builds.created_at BETWEEN ? AND ?) AND (ci_builds.updated_at BETWEEN ? AND ?)', lookback, timeout, lookback, timeout) + } scope :for_project_paths, -> (paths) do where(project: Project.where_full_path_in(Array(paths))) @@ -174,8 +177,11 @@ class CommitStatus < ApplicationRecord next if commit_status.processed? next unless commit_status.project + last_arg = transition.args.last + transition_options = last_arg.is_a?(Hash) && last_arg.extractable_options? ? last_arg : {} + commit_status.run_after_commit do - PipelineProcessWorker.perform_async(pipeline_id) + PipelineProcessWorker.perform_async(pipeline_id) unless transition_options[:skip_pipeline_processing] ExpireJobCacheWorker.perform_async(id) end end |