debian-mirror-gitlab/app/services/onboarding_progress_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
639 B
Ruby
Raw Normal View History

2021-02-22 17:27:13 +05:30
# frozen_string_literal: true
class OnboardingProgressService
2021-04-17 20:07:23 +05:30
class Async
attr_reader :namespace_id
def initialize(namespace_id)
@namespace_id = namespace_id
end
def execute(action:)
return unless OnboardingProgress.not_completed?(namespace_id, action)
Namespaces::OnboardingProgressWorker.perform_async(namespace_id, action)
end
end
def self.async(namespace_id)
Async.new(namespace_id)
end
2021-02-22 17:27:13 +05:30
def initialize(namespace)
2021-03-08 18:12:59 +05:30
@namespace = namespace&.root_ancestor
2021-02-22 17:27:13 +05:30
end
def execute(action:)
2021-03-08 18:12:59 +05:30
return unless @namespace
OnboardingProgress.register(@namespace, action)
2021-02-22 17:27:13 +05:30
end
end