diff --git a/turbinia/state_manager.py b/turbinia/state_manager.py index 1f489e3d4..361da7715 100644 --- a/turbinia/state_manager.py +++ b/turbinia/state_manager.py @@ -193,7 +193,7 @@ def get_task_data( """ tasks = [ json.loads(self.client.get(task)) - for task in self.client.scan_iter('TurbiniaTask:*') + for task in self.client.scan_iter(match='TurbiniaTask:*', count=1000) if json.loads(self.client.get(task)).get('instance') == instance or not instance ] @@ -339,7 +339,7 @@ def iterate_keys(self, key_type: str) -> Iterator[str]: decode fails. """ try: - keys = self.client.scan_iter(f'Turbinia{key_type.title()}:*') + keys = self.client.scan_iter(f'Turbinia{key_type.title()}:*', count=1000) except redis.RedisError as exception: error_message = f'Error getting {key_type} keys in Redis' log.error(f'{error_message}: {exception}') @@ -366,7 +366,7 @@ def iterate_attributes(self, key: str) -> Iterator[tuple]: decode or json loads fails. """ try: - attributes = self.client.hscan_iter(key) + attributes = self.client.hscan_iter(key, count=100) except redis.RedisError as exception: error_message = f'Error getting attributes from {key} in Redis' log.error(f'{error_message}: {exception}')