Fix PEP8 complaints

main
Vincent Driessen 8 years ago
parent a689cdb3ec
commit af6ce54ea4

@ -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:

@ -579,4 +579,5 @@ class Job(object):
def __hash__(self):
return hash(self.id)
_job_stack = LocalStack()

@ -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)
@ -544,7 +545,7 @@ class Worker(object):
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

@ -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)
@ -678,6 +679,7 @@ class WorkerShutdownTestCase(TimeoutTestCase, RQTestCase):
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)

Loading…
Cancel
Save