From 10230ff0404073d892418c04879d8f04ad57ca9e Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Sun, 11 Jun 2023 17:47:31 -0700 Subject: [PATCH] Fix a few concatenated strings that don't have to be (#1941) --- rq/queue.py | 2 +- rq/timeouts.py | 2 +- rq/worker.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rq/queue.py b/rq/queue.py index e0e48c5e..fc3bd47d 100644 --- a/rq/queue.py +++ b/rq/queue.py @@ -893,7 +893,7 @@ class Queue: kwargs (*kwargs): function kargs """ if not isinstance(f, str) and f.__module__ == '__main__': - raise ValueError('Functions from the __main__ module cannot be processed ' 'by workers') + raise ValueError('Functions from the __main__ module cannot be processed by workers') # Detect explicit invocations, i.e. of the form: # q.enqueue(foo, args=(1, 2), kwargs={'a': 1}, job_timeout=30) diff --git a/rq/timeouts.py b/rq/timeouts.py index a8a408c6..12eef56d 100644 --- a/rq/timeouts.py +++ b/rq/timeouts.py @@ -60,7 +60,7 @@ class BaseDeathPenalty: class UnixSignalDeathPenalty(BaseDeathPenalty): def handle_death_penalty(self, signum, frame): - raise self._exception('Task exceeded maximum timeout value ' '({0} seconds)'.format(self._timeout)) + raise self._exception('Task exceeded maximum timeout value ({0} seconds)'.format(self._timeout)) def setup_death_penalty(self): """Sets up an alarm signal and a signal handler that raises diff --git a/rq/worker.py b/rq/worker.py index 44d52040..7b16cc00 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -653,7 +653,7 @@ class BaseWorker: connection: Union[Redis, 'Pipeline'] = pipeline if pipeline is not None else self.connection connection.expire(self.key, timeout) connection.hset(self.key, 'last_heartbeat', utcformat(utcnow())) - self.log.debug('Sent heartbeat to prevent worker timeout. ' 'Next one should arrive in %s seconds.', timeout) + self.log.debug('Sent heartbeat to prevent worker timeout. Next one should arrive in %s seconds.', timeout) class Worker(BaseWorker): @@ -947,7 +947,7 @@ class Worker(BaseWorker): if self.get_state() == WorkerStatus.BUSY: self._stop_requested = True self.set_shutdown_requested_date() - self.log.debug('Stopping after current horse is finished. ' 'Press Ctrl+C again for a cold shutdown.') + self.log.debug('Stopping after current horse is finished. Press Ctrl+C again for a cold shutdown.') if self.scheduler: self.stop_scheduler() else: