Class: SidekiqUniqueJobs::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/sidekiq_unique_jobs/cli.rb

Instance Method Summary collapse

Instance Method Details

#consoleObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/sidekiq_unique_jobs/cli.rb', line 19

def console
  puts "Use `keys '*', count: 1000 to display the first 1000 unique keys matching '*'"
  puts "Use `del '*', count: 1000 to see how many keys would be deleted for the pattern '*'"
  puts "Use `del '*', dry_run: false, count: 1000 to delete the first 1000 keys matching '*'"
  begin
    require 'pry'
    Object.include SidekiqUniqueJobs::Util
    Pry.start
  rescue LoadError
    require 'irb'
    Object.include SidekiqUniqueJobs::Util
    IRB.start
  end
end

#del_by(pattern) ⇒ Object



14
15
16
# File 'lib/sidekiq_unique_jobs/cli.rb', line 14

def del_by(pattern)
  Util.del_by(pattern, dry_run: dry_run, count: count)
end

#keys(pattern) ⇒ Object



7
8
9
# File 'lib/sidekiq_unique_jobs/cli.rb', line 7

def keys(pattern)
  Util.keys(pattern, count: options[:count])
end