mirror of https://github.com/rq/rq.git
Fix some code quality issues (#1235)
This commit is contained in:
parent
eb92d688a8
commit
b2be17417f
|
@ -0,0 +1,12 @@
|
||||||
|
version = 1
|
||||||
|
|
||||||
|
test_patterns = ["tests/**"]
|
||||||
|
|
||||||
|
exclude_patterns = ["examples/**"]
|
||||||
|
|
||||||
|
[[analyzers]]
|
||||||
|
name = "python"
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[analyzers.meta]
|
||||||
|
runtime_version = "3.x.x"
|
|
@ -1,2 +1,3 @@
|
||||||
include LICENSE
|
include LICENSE
|
||||||
|
include *.toml
|
||||||
recursive-exclude tests *
|
recursive-exclude tests *
|
||||||
|
|
|
@ -143,7 +143,7 @@ def show_workers(queues, raw, by_queue, queue_class, worker_class):
|
||||||
queue_dict[queue] = worker_class.all(queue=queue)
|
queue_dict[queue] = worker_class.all(queue=queue)
|
||||||
|
|
||||||
if queue_dict:
|
if queue_dict:
|
||||||
max_length = max([len(q.name) for q, in queue_dict.keys()])
|
max_length = max(len(q.name) for q, in queue_dict.keys())
|
||||||
else:
|
else:
|
||||||
max_length = 0
|
max_length = 0
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class RQScheduler(object):
|
||||||
|
|
||||||
def __init__(self, queues, connection, interval=1):
|
def __init__(self, queues, connection, interval=1):
|
||||||
self._queue_names = set(parse_names(queues))
|
self._queue_names = set(parse_names(queues))
|
||||||
self._acquired_locks = set([])
|
self._acquired_locks = set()
|
||||||
self._scheduled_job_registries = []
|
self._scheduled_job_registries = []
|
||||||
self.lock_acquisition_time = None
|
self.lock_acquisition_time = None
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
|
@ -68,7 +68,7 @@ class RQScheduler(object):
|
||||||
|
|
||||||
def acquire_locks(self, auto_start=False):
|
def acquire_locks(self, auto_start=False):
|
||||||
"""Returns names of queue it successfully acquires lock on"""
|
"""Returns names of queue it successfully acquires lock on"""
|
||||||
successful_locks = set([])
|
successful_locks = set()
|
||||||
pid = os.getpid()
|
pid = os.getpid()
|
||||||
logging.info("Trying to acquire locks for %s", ", ".join(self._queue_names))
|
logging.info("Trying to acquire locks for %s", ", ".join(self._queue_names))
|
||||||
for name in self._queue_names:
|
for name in self._queue_names:
|
||||||
|
|
Loading…
Reference in New Issue