Method: OpenC3::ReactionWorker#run_command

Defined in:
lib/openc3/microservices/reaction_microservice.rb

#run_command(reaction:, action:) ⇒ Object



331
332
333
334
335
336
337
338
339
340
341
# File 'lib/openc3/microservices/reaction_microservice.rb', line 331

def run_command(reaction:, action:)
  begin
    username = reaction.username
    token = get_token(username)
    raise "No token available for username: #{username}" unless token
    cmd_no_hazardous_check(action['value'], scope: @scope, token: token)
    @logger.info "ReactionWorker-#{@ident} #{reaction.name} command action complete, command: #{action['value']}"
  rescue StandardError => e
    @logger.error "ReactionWorker-#{@ident} #{reaction.name} command action failed, #{action}\n#{e.message}"
  end
end