Merge pull request #31800 from ankush/fix_rq_worker_count
fix: rq worker count
This commit is contained in:
commit
fa94b03038
3 changed files with 10 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
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class MariaDBExceptionUtil:
|
|||
InternalError = pymysql.InternalError
|
||||
SQLError = pymysql.ProgrammingError
|
||||
DataError = pymysql.DataError
|
||||
InterfaceError = pymysql.InterfaceError
|
||||
|
||||
# match ER_SEQUENCE_RUN_OUT - https://mariadb.com/kb/en/mariadb-error-codes/
|
||||
SequenceGeneratorLimitExceeded = pymysql.OperationalError
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class MariaDBExceptionUtil:
|
|||
InternalError = MySQLdb.InternalError
|
||||
SQLError = MySQLdb.ProgrammingError
|
||||
DataError = MySQLdb.DataError
|
||||
InterfaceError = MySQLdb.InterfaceError
|
||||
|
||||
# match SEQUENCE_RUN_OUT - https://mariadb.com/kb/en/mariadb-error-codes/
|
||||
SequenceGeneratorLimitExceeded = MySQLdb.OperationalError
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue