Sha256: b3292c07014b8595e269b76b9f1603c4f648457dc1e37f142bc398aa40230808
Contents?: true
Size: 847 Bytes
Versions: 2
Compression:
Stored size: 847 Bytes
Contents
module Resque module Failure # A Failure backend that stores exceptions in Mongo. Very simple but # works out of the box, along with support in the Resque web app. class Mongo < Base def save data = { :failed_at => Time.now.strftime("%Y/%m/%d %H:%M:%S"), :payload => payload, :error => exception.to_s, :backtrace => exception.backtrace, :worker => worker.to_s, :queue => queue } Resque.mongo_failures << data end def self.count Resque.mongo_failures.count end def self.all(start = 0, count = 1) Resque.mongo_failures.find().sort([:natural, :desc]).skip(start).limit(count).to_a end def self.clear Resque.mongo_failures.remove end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
resque-mongo-1.4.0 | lib/resque/failure/mongo.rb |
resque-mongo-1.3.1 | lib/resque/failure/mongo.rb |