Skip to content

Commit

Permalink
Fix some code quality issues (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnijhara committed May 3, 2020
1 parent eb92d68 commit b2be174
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .deepsource.toml
@@ -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 change: 1 addition & 0 deletions MANIFEST.in
@@ -1,2 +1,3 @@
include LICENSE
include *.toml
recursive-exclude tests *
2 changes: 1 addition & 1 deletion rq/cli/helpers.py
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions rq/scheduler.py
Expand Up @@ -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
Expand Down Expand Up @@ -68,7 +68,7 @@ def should_reacquire_locks(self):

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:
Expand Down

0 comments on commit b2be174

Please sign in to comment.