Пример #1
0
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)
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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
Пример #5
0
 def fail_count(self):
     #from pyres.failure import Failure
     return str(failure.count(self.resq))
Пример #6
0
 def size(self):
     return str(failure.count(self.resq) or 0)
Пример #7
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
Пример #8
0
 def fail_count(self):
     #from pyres.failure import Failure
     return str(failure.count(self.resq))
Пример #9
0
 def size(self):
     return str(failure.count(self.resq) or 0)
Пример #10
0
 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
Пример #11
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
Пример #12
0
 def fail_count(self):
     return failure.count(self.resq)