Esempio n. 1
0
def retry_failed(request, number=5000):
    # get /failed/retry_all
    resq = get_pyres()
    failures = failure.all(resq, 0, number)
    for f in failures:
        j = b64decode(f['redis_value'])
        failure.retry(resq, f['queue'], j)
    return redirect('resweb-failed')
Esempio n. 2
0
 def failed_jobs(self):
     jobs = []
     for job in failure.all(self.resq, self._start, self._start + 20):
         item = job
         item['worker_url'] = '/workers/%s/' % job['worker']
         item['payload_args'] = ','.join(job['payload']['args'])
         item['payload_class'] = job['payload']['class']
         item['traceback'] = '\n'.join(job['backtrace'])
         jobs.append(item)
     return jobs
Esempio n. 3
0
    def failed_jobs(self):
        jobs = []
        for j in failure.all(self.resq, self._start, self._end):
            backtrace = j['backtrace']
            if isinstance(backtrace, list):
                j['backtrace'] = '\n'.join(backtrace)

            j['payload_class'] = j['payload']['class']
            j['payload_args'] = str(j['payload']['args'])[:1024]
            jobs.append(WebContainer(**j))
        return jobs
Esempio n. 4
0
    def failed_jobs(self):
        jobs = []
        for job in failure.all(self.resq, self._start, self._start + 20):
            item = job
            item["failed_at"] = str(datetime.datetime.fromtimestamp(float(job["failed_at"])))
            item["worker_url"] = "/workers/%s/" % job["worker"]
            item["payload_args"] = str(job["payload"]["args"])[:1024]
            item["payload_class"] = job["payload"]["class"]
            item["traceback"] = job["backtrace"]
            jobs.append(item)

        return jobs
Esempio n. 5
0
    def failed_jobs(self):
        jobs = []
        for job in failure.all(self.resq, self._start, self._start + 20):
            backtrace = job['backtrace']

            if isinstance(backtrace, list):
                backtrace = '\n'.join(backtrace)

            item = job
            item['failed_at'] = job['failed_at']
            item['worker_url'] = '/workers/%s/' % job['worker']
            item['payload_args'] = str(job['payload']['args'])[:1024]
            item['payload_class'] = job['payload']['class']
            item['traceback'] = backtrace
            jobs.append(item)

        return jobs
Esempio n. 6
0
 def failed_jobs(self):
     from base64 import b64encode
     try:
         import json
     except ImportError:
         import simplejson as json
     jobs = []
     for job in failure.all(self.resq, self._start, self._start + 20):
         item = job
         item['failed_at'] = str(
             datetime.datetime.fromtimestamp(float(job['failed_at'])))
         item['worker_url'] = '/workers/%s/' % job['worker']
         item['payload_args'] = str(job['payload']['args'])
         item['payload_class'] = job['payload']['class']
         item['traceback'] = job['backtrace']
         jobs.append(item)
     return jobs
Esempio n. 7
0
    def failed_jobs(self):
        jobs = []
        for job in failure.all(self.resq, self._start, self._start + 20):
            backtrace = job['backtrace']

            if isinstance(backtrace, list):
                backtrace = '\n'.join(backtrace)

            item = job
            item['failed_at'] = job['failed_at']
            item['worker_url'] = '/workers/%s/' % job['worker']
            item['payload_args'] = str(job['payload']['args'])[:1024]
            item['payload_class'] = job['payload']['class']
            item['traceback'] = backtrace
            jobs.append(item)

        return jobs
Esempio n. 8
0
def get_failed():
    start = int(request.args.get("start", 0))
    limit = int(request.args.get("limit", 250))
    jobs = []
    for resq in RESQUES:
        for job in failure.all(resq, start, start+limit):
            backtrace = job['backtrace']

            if isinstance(backtrace, list):
                backtrace = '\n'.join(backtrace)

            item = job
            item['failed_at'] = job['failed_at']
            item['worker'] = job['worker']
            item['payload_args'] = str(job['payload']['args'])[:1024]
            item['payload_class'] = job['payload']['class']
            item['traceback'] = backtrace
            jobs.append(item)

    return render_template("failures.html", jobs=jobs, dsn=DSN, limit=limit)
Esempio n. 9
0
def retry_failed(request, number=5000):
    failures = failure.all(HOST, 0, number)
    for f in failures:
        j = b64decode(f['redis_value'])
        failure.retry(HOST, f['queue'], j)
    raise Redirect('/failed/')
Esempio n. 10
0
File: core.py Progetto: Pyres/resweb
def retry_failed(number=5000):
    failures = failure.all(g.pyres, 0, number)
    for f in failures:
        j = b64decode(f['redis_value'])
        failure.retry(g.pyres, f['queue'], j)
    return redirect(url_for('.failed'))
Esempio n. 11
0
 def test_all(self):
     self.resq.enqueue(self.job_class, "test1")
     job = Job.reserve(self.queue_name, self.resq)
     e = Exception('problem')
     job.fail(e)
     assert len(failure.all(self.resq, 0, 20)) == 1
Esempio n. 12
0
 def test_all(self):
     self.resq.enqueue(Basic,"test1")
     job = Job.reserve('basic',self.resq)
     e = Exception('problem')
     job.fail(e)
     assert len(failure.all(self.resq, 0, 20)) == 1
Esempio n. 13
0
def retry_failed(request, number=5000):
    failures = failure.all(HOST, 0, number)
    for f in failures:
        j = b64decode(f['redis_value'])
        failure.retry(HOST, f['queue'], j)
    raise Redirect('/failed/')
Esempio n. 14
0
def retry_failed(number=5000):
    failures = failure.all(g.pyres, 0, number)
    for f in failures:
        j = b64decode(f['redis_value'])
        failure.retry(g.pyres, f['queue'], j)
    return redirect(url_for('.failed'))
Esempio n. 15
0
 def test_all(self):
     self.resq.enqueue(self.job_class,"test1")
     job = Job.reserve(self.queue_name,self.resq)
     e = Exception('problem')
     job.fail(e)
     assert len(failure.all(self.resq, 0, 20)) == 1