From 7efd036a2c7b5db6d91a3725152747d9bc240ada Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Mon, 13 Jun 2016 18:29:16 +0100 Subject: [PATCH] move ShutDownImminentException into exceptions.py --- rq/exceptions.py | 6 ++++++ rq/worker.py | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) 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: