Skip to content

Commit d2eef2e

Browse files
author
sam
committed
fix for cancelling individual jobs
disable logging
1 parent 02d917e commit d2eef2e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rq_dashboard/web.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@
2222
import arrow
2323
from flask import Blueprint, current_app, render_template, url_for
2424
from redis import Redis, from_url
25-
from rq import (Queue, Worker, cancel_job, get_failed_queue, pop_connection,
25+
from rq import (Queue, Worker, job, get_failed_queue, pop_connection,
2626
push_connection, requeue_job)
2727

28+
import logging
29+
30+
logging.disable(logging.INFO)
31+
2832
blueprint = Blueprint(
2933
'rq_dashboard',
3034
__name__,
@@ -132,7 +136,7 @@ def overview(queue_name, page):
132136
@blueprint.route('/job/<job_id>/cancel', methods=['POST'])
133137
@jsonify
134138
def cancel_job_view(job_id):
135-
cancel_job(job_id)
139+
job.Job.fetch(job_id).delete()
136140
return dict(status='OK')
137141

138142

0 commit comments

Comments
 (0)