diff --git a/rq/exceptions.py b/rq/exceptions.py index 88bbbb0..530733d 100644 --- a/rq/exceptions.py +++ b/rq/exceptions.py @@ -19,3 +19,9 @@ class UnpickleError(Exception): class DequeueTimeout(Exception): pass + + +class ShutDownImminentException(Exception): + def __init__(self, msg, extra_info): + self.extra_info = extra_info + super(ShutDownImminentException, self).__init__(msg) diff --git a/rq/worker.py b/rq/worker.py index 235b8af..f7c8c63 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -18,7 +18,7 @@ from rq.compat import as_text, string_types, text_type from .connections import get_current_connection, push_connection, pop_connection from .defaults import DEFAULT_RESULT_TTL, DEFAULT_WORKER_TTL -from .exceptions import DequeueTimeout +from .exceptions import DequeueTimeout, ShutDownImminentException from .job import Job, JobStatus from .logutils import setup_loghandlers from .queue import Queue, get_failed_queue @@ -722,12 +722,6 @@ class SimpleWorker(Worker): return self.perform_job(*args, **kwargs) -class ShutDownImminentException(Exception): - def __init__(self, msg, extra_info): - self.extra_info = extra_info - super(ShutDownImminentException, self).__init__(msg) - - class HerokuWorker(Worker): """ Modified version of rq worker which: