diff --git a/pyproject.toml b/pyproject.toml index 7054c05..373e224 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "sergeant" -version = "0.26.0" +version = "0.27.0" readme = "README.md" homepage = "https://github.com/Intsights/sergeant" repository = "https://github.com/Intsights/sergeant" diff --git a/sergeant/connector/local.py b/sergeant/connector/local.py index 6181ec3..11301c7 100644 --- a/sergeant/connector/local.py +++ b/sergeant/connector/local.py @@ -311,7 +311,7 @@ def queue_push( priority: str = 'NORMAL', consumable_from: typing.Optional[float] = None, ) -> bool: - if consumable_from is not None: + if consumable_from: priority_value = consumable_from elif priority == 'HIGH': priority_value = 0.0 @@ -341,7 +341,7 @@ def queue_push_bulk( priority: str = 'NORMAL', consumable_from: typing.Optional[float] = None, ) -> bool: - if consumable_from is not None: + if consumable_from: priority_value = consumable_from elif priority == 'HIGH': priority_value = 0.0 diff --git a/sergeant/connector/mongo.py b/sergeant/connector/mongo.py index 2862ffc..2daa41c 100644 --- a/sergeant/connector/mongo.py +++ b/sergeant/connector/mongo.py @@ -356,7 +356,7 @@ def queue_push( priority: str = 'NORMAL', consumable_from: typing.Optional[float] = None, ) -> bool: - if consumable_from is not None: + if consumable_from: priority_value = consumable_from elif priority == 'HIGH': priority_value = 0.0 @@ -382,7 +382,7 @@ def queue_push_bulk( priority: str = 'NORMAL', consumable_from: typing.Optional[float] = None, ) -> bool: - if consumable_from is not None: + if consumable_from: priority_value = consumable_from elif priority == 'HIGH': priority_value = 0.0 diff --git a/sergeant/connector/redis.py b/sergeant/connector/redis.py index 426d120..4f8cd95 100644 --- a/sergeant/connector/redis.py +++ b/sergeant/connector/redis.py @@ -312,7 +312,7 @@ def queue_push( priority: str = 'NORMAL', consumable_from: typing.Optional[float] = None, ) -> bool: - if consumable_from is None: + if not consumable_from: if priority == 'HIGH': return self.next_connection.lpush(queue_name, item) > 0 else: @@ -333,7 +333,7 @@ def queue_push_bulk( priority: str = 'NORMAL', consumable_from: typing.Optional[float] = None, ) -> bool: - if consumable_from is None: + if not consumable_from: if priority == 'HIGH': return self.next_connection.lpush(queue_name, *items) > 0 else: