Skip to content

Commit

Permalink
Fix PEP8 complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Nov 18, 2016
1 parent a689cdb commit af6ce54
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rq/cli/cli.py
Expand Up @@ -153,8 +153,8 @@ def info(url, config, path, interval, raw, only_queues, only_workers, by_queue,
@click.option('--exception-handler', help='Exception handler(s) to use', multiple=True)
@click.option('--pid', help='Write the process ID number to a file at the specified path')
@click.argument('queues', nargs=-1)
def worker(url, config, burst, name, worker_class, job_class, queue_class, connection_class, path, results_ttl, worker_ttl,
verbose, quiet, sentry_dsn, exception_handler, pid, queues):
def worker(url, config, burst, name, worker_class, job_class, queue_class, connection_class, path, results_ttl,
worker_ttl, verbose, quiet, sentry_dsn, exception_handler, pid, queues):
"""Starts an RQ worker."""

if path:
Expand Down
1 change: 1 addition & 0 deletions rq/job.py
Expand Up @@ -579,4 +579,5 @@ def __eq__(self, other): # noqa
def __hash__(self):
return hash(self.id)


_job_stack = LocalStack()
5 changes: 3 additions & 2 deletions rq/worker.py
Expand Up @@ -55,6 +55,7 @@ def iterable(x):
def compact(l):
return [x for x in l if x is not None]


_signames = dict((getattr(signal, signame), signame)
for signame in dir(signal)
if signame.startswith('SIG') and '_' not in signame)
Expand Down Expand Up @@ -544,7 +545,7 @@ def monitor_work_horse(self, job):
except Exception:
pass

#Unhandled failure: move the job to the failed queue
# Unhandled failure: move the job to the failed queue
self.log.warning(
'Moving job to {0!r} queue'.format(
self.failed_queue.name
Expand Down Expand Up @@ -826,7 +827,7 @@ def request_stop_sigrtmin(self, signum, frame):
self.request_force_stop_sigrtmin(signum, frame)
else:
self.log.warning('Imminent shutdown, raising ShutDownImminentException in %d seconds',
self.imminent_shutdown_delay)
self.imminent_shutdown_delay)
signal.signal(signal.SIGRTMIN, self.request_force_stop_sigrtmin)
signal.signal(signal.SIGALRM, self.request_force_stop_sigrtmin)
signal.alarm(self.imminent_shutdown_delay)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_worker.py
Expand Up @@ -577,6 +577,7 @@ def kill_worker(pid, double_kill):
time.sleep(0.5)
os.kill(pid, signal.SIGTERM)


def wait_and_kill_work_horse(pid, time_to_wait=0.0):
time.sleep(time_to_wait)
os.kill(pid, signal.SIGKILL)
Expand Down Expand Up @@ -678,6 +679,7 @@ def test_work_horse_death_sets_job_failed(self):
self.assertEqual(failed_q.count, 1)
self.assertEqual(fooq.count, 0)


def schedule_access_self():
q = Queue('default', connection=get_current_connection())
q.enqueue(access_self)
Expand Down

0 comments on commit af6ce54

Please sign in to comment.