Module: Legion::API::Routes::Governance::GovernanceHelpers

Defined in:
lib/legion/api/governance.rb

Instance Method Summary collapse

Instance Method Details

#run_governance_runner(method) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/legion/api/governance.rb', line 13

def run_governance_runner(method, **)
  require 'legion/extensions/audit/runners/approval_queue'
  runner = Object.new.extend(Legion::Extensions::Audit::Runners::ApprovalQueue)
  runner.send(method, **)
rescue LoadError => e
  Legion::Logging.warn "Governance#run_governance_runner failed to load lex-audit: #{e.message}" if defined?(Legion::Logging)
  halt 503, json_error('service_unavailable', 'lex-audit not available', status_code: 503)
end