Class: Shipit::RefreshStatusesJob

Inherits:
BackgroundJob
  • Object
show all
Defined in:
app/jobs/shipit/refresh_statuses_job.rb

Constant Summary

Constants inherited from BackgroundJob

BackgroundJob::DEFAULT_RETRY_TIME_IN_SECONDS

Instance Method Summary collapse

Instance Method Details

#perform(params) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/jobs/shipit/refresh_statuses_job.rb', line 7

def perform(params)
  if params[:commit_id]
    Commit.find(params[:commit_id]).refresh_statuses!
  else
    stack = Stack.find(params[:stack_id])
    stack.commits.order(id: :desc).limit(30).each(&:refresh_statuses!)
  end
end