def requeue_job():
    job_id = request.args(0) or None
    rq = RqConn()
    return rq.requeue_job(job_id)
def requeue_failed():
    rq = RqConn()
    failed_jobs = rq.list_jobs('failed')
    for job in failed_jobs:
        rq.requeue_job(job['id'])
    return 0