def home(): queue_stats = defaultdict(int) queues = RESQUES[0].queues() for resq in RESQUES: for q in queues: queue_stats[q] += resq.size(q) queue_stats["failed"] += failure.count(resq) return render_template("index.html", queue_stats=queue_stats, dsn=DSN)
def test_create(self): self.resq.enqueue(self.job_class, "test1") job = Job.reserve(self.queue_name, self.resq) e = Exception('test') fail = failure.create(e, self.queue_name, job._payload) assert isinstance(fail._payload, dict) fail.save(self.resq) assert failure.count(self.resq) == 1 assert self.redis.llen('resque:failed') == 1
def test_create(self): self.resq.enqueue(Basic,"test1") job = Job.reserve('basic',self.resq) e = Exception('test') fail = failure.create(e, 'basic', job._payload) assert isinstance(fail._payload, dict) fail.save() assert failure.count(self.resq) == 1 assert self.redis.llen('resque:failed') == 1
def test_create(self): self.resq.enqueue(self.job_class, "test1") job = Job.reserve(self.queue_name, self.resq) e = Exception("test") fail = failure.create(e, self.queue_name, job._payload) assert isinstance(fail._payload, dict) fail.save(self.resq) assert failure.count(self.resq) == 1 assert self.redis.llen("resque:failed") == 1
def fail_count(self): #from pyres.failure import Failure return str(failure.count(self.resq))
def size(self): return str(failure.count(self.resq) or 0)
def test_count(self): self.resq.enqueue(self.job_class, "test1") job = Job.reserve(self.queue_name, self.resq) job.fail("problem") assert failure.count(self.resq) == 1 assert self.redis.llen('resque:failed') == 1
def test_count(self): self.resq.enqueue(Basic,"test1") job = Job.reserve('basic',self.resq) job.fail("problem") assert failure.count(self.resq) == 1 assert self.redis.llen('resque:failed') == 1
def test_count(self): self.resq.enqueue(self.job_class,"test1") job = Job.reserve(self.queue_name,self.resq) job.fail("problem") assert failure.count(self.resq) == 1 assert self.redis.llen('resque:failed') == 1
def fail_count(self): return failure.count(self.resq)