summaryrefslogtreecommitdiff
path: root/app/workers/destroy_pages_deployments_worker.rb
blob: 32b539325c9020727d89b5726d0d96a6769df255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class DestroyPagesDeploymentsWorker
  include ApplicationWorker

  idempotent!

  loggable_arguments 0, 1
  sidekiq_options retry: 3
  feature_category :pages

  def perform(project_id, last_deployment_id = nil)
    project = Project.find_by_id(project_id)

    return unless project

    ::Pages::DestroyDeploymentsService.new(project, last_deployment_id).execute
  end
end