mirror of https://github.com/peter4431/rq.git
Merge pull request #833 from yaniv-g/extract_move_to_failed_queue
Expose move_to_failed_queue from Workermain
commit
8ebebc9f7c
@ -0,0 +1,12 @@
|
||||
import traceback
|
||||
|
||||
from .connections import get_current_connection
|
||||
from .queue import get_failed_queue
|
||||
from .worker import Worker
|
||||
|
||||
|
||||
def move_to_failed_queue(job, *exc_info):
|
||||
"""Default exception handler: move the job to the failed queue."""
|
||||
exc_string = Worker._get_safe_exception_string(traceback.format_exception(*exc_info))
|
||||
failed_queue = get_failed_queue(get_current_connection(), job.__class__)
|
||||
failed_queue.quarantine(job, exc_info=exc_string)
|
Loading…
Reference in New Issue