Sha256: f75f7d9c689e6e95cc2048d2cf4c994cb8e2427d4ff6fa2252faa8ed3194f810

Contents?: true

Size: 816 Bytes

Versions: 6

Compression:

Stored size: 816 Bytes

Contents

if Gem::Specification.find_all_by_name("sidekiq", ">=1.0.0").count >= 1
  SIDEKIQ_INSTALLED = true
  require 'sidekiq'
else
  SIDEKIQ_INSTALLED = false
  puts "sidekiq gem not installed, skipping crawl_worker specs"
end
if Gem::Specification.find_all_by_name("resque", ">=1.0.0").count >= 1
  RESQUE_INSTALLED = true
  require 'resque'
else
  RESQUE_INSTALLED = false
  puts "resque gem not installed, skipping crawl_job specs"
end

module Sidekiq
  module Worker
    module ClassMethods
      def queue_size
        Sidekiq.redis do |conn|
          conn.llen("queue:#{get_sidekiq_options["queue"]}")
        end
      end
      def queue_items(start=0, finish=-1)
        Sidekiq.redis do |conn|
          conn.lrange("queue:#{get_sidekiq_options["queue"]}", start, finish)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cobweb-1.0.26 lib/sidekiq/cobweb_helper.rb
cobweb-1.0.24 lib/sidekiq/cobweb_helper.rb
cobweb-1.0.23 lib/sidekiq/cobweb_helper.rb
cobweb-1.0.22 lib/sidekiq/cobweb_helper.rb
cobweb-1.0.21 lib/sidekiq/cobweb_helper.rb
cobweb-1.0.20 lib/sidekiq/cobweb_helper.rb