Class: Redirus::ServerCLI

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/redirus/server_cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



16
17
18
# File 'lib/redirus/server_cli.rb', line 16

def options
  @options
end

Instance Method Details

#parse(args = ARGV) ⇒ Object



18
19
20
21
# File 'lib/redirus/server_cli.rb', line 18

def parse(args = ARGV)
  init_options(args)
  validate!
end

#runObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/redirus/server_cli.rb', line 23

def run
  sidekiq_cli = Sidekiq::CLI.instance
  args = queues + [
    '-c', '1',
    '-r', runner_path,
    options[:config_path]
  ]

  sidekiq_cli.parse(args)
  sidekiq_cli.run
end