Class: Kitsune::Kit::Workflows::ImportServer

Inherits:
Base
  • Object
show all
Defined in:
lib/kitsune/kit/workflows/import_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(config:, provider:, state_store:, event_bus: Events::NullBus.new, clock: Clock.new) ⇒ ImportServer

Returns a new instance of ImportServer.



11
12
13
14
15
# File 'lib/kitsune/kit/workflows/import_server.rb', line 11

def initialize(config:, provider:, state_store:, event_bus: Events::NullBus.new, clock: Clock.new)
  super(config: config, event_bus: event_bus, clock: clock)
  @provider = provider
  @state_store = state_store
end

Instance Method Details

#call(provider_id:, confirmation:) ⇒ Object



17
18
19
20
21
22
# File 'lib/kitsune/kit/workflows/import_server.rb', line 17

def call(provider_id:, confirmation:)
  validate_inputs!(provider_id, confirmation)
  @state_store.with_execution_lock(config.environment) do
    import_locked(provider_id.to_s)
  end
end