fix: RQ Worker count
This commit is contained in:
parent
99ce5e1815
commit
f02ef4a905
1 changed files with 8 additions and 2 deletions
|
|
@ -45,10 +45,16 @@ class RQWorker(Document):
|
|||
super(Document, self).__init__(d)
|
||||
|
||||
@staticmethod
|
||||
def get_list(start=0, page_length=20):
|
||||
def get_list(start=0, page_length=0):
|
||||
workers = get_workers()
|
||||
|
||||
valid_workers = [w for w in workers if w.pid][start : start + page_length]
|
||||
valid_workers = [w for w in workers if w.pid]
|
||||
|
||||
if page_length:
|
||||
valid_workers = valid_workers[start : start + page_length]
|
||||
else:
|
||||
valid_workers = valid_workers[start:]
|
||||
|
||||
return [serialize_worker(worker) for worker in valid_workers]
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue