Fix some code quality issues (#1235)

This commit is contained in:
Prajjwal Nijhara 2020-05-03 16:05:01 +05:30 committed by GitHub
parent eb92d688a8
commit b2be17417f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 3 deletions

12
.deepsource.toml Normal file
View File

@ -0,0 +1,12 @@
version = 1
test_patterns = ["tests/**"]
exclude_patterns = ["examples/**"]
[[analyzers]]
name = "python"
enabled = true
[analyzers.meta]
runtime_version = "3.x.x"

View File

@ -1,2 +1,3 @@
include LICENSE
include *.toml
recursive-exclude tests *

View File

@ -143,7 +143,7 @@ def show_workers(queues, raw, by_queue, queue_class, worker_class):
queue_dict[queue] = worker_class.all(queue=queue)
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:
max_length = 0

View File

@ -40,7 +40,7 @@ class RQScheduler(object):
def __init__(self, queues, connection, interval=1):
self._queue_names = set(parse_names(queues))
self._acquired_locks = set([])
self._acquired_locks = set()
self._scheduled_job_registries = []
self.lock_acquisition_time = None
self.connection = connection
@ -68,7 +68,7 @@ class RQScheduler(object):
def acquire_locks(self, auto_start=False):
"""Returns names of queue it successfully acquires lock on"""
successful_locks = set([])
successful_locks = set()
pid = os.getpid()
logging.info("Trying to acquire locks for %s", ", ".join(self._queue_names))
for name in self._queue_names: