Sha256: ef8ca2846808f79e2c5ef83383f26644916daa97dca6c62c3a5d56442d5f3fc8
Contents?: true
Size: 523 Bytes
Versions: 3
Compression:
Stored size: 523 Bytes
Contents
require 'logger' class Processor @queue = :processor def self.connection @log ||= Logger.new(STDOUT) @con ||= Mongo::Connection.new("localhost", 27017) end def self.perform(n) begin 100.times do |n| self.connection['resque']['docs'].insert({:n => n, :data => "0" * 1000}, :safe => true) end 5.times do |n| num = rand(100) self.connection['resque']['docs'].find({:n => {"$gt" => num}}).limit(1).to_a end rescue => e @log.warn(e.inspect) end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
vanity-1.7.1 | vendor/ruby/1.9.1/gems/mongo-1.3.1/test/load/resque/processor.rb |
mongo-1.3.1 | test/load/resque/processor.rb |
mongo-1.3.0 | test/load/resque/processor.rb |