Skip to content

Commit

Permalink
Update number of results returned by scan_iter in Redis state manager (
Browse files Browse the repository at this point in the history
…#1455)

* Update scan_iter counts

* Update
  • Loading branch information
jleaniz authored Mar 12, 2024
1 parent b5c3981 commit e102b06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions turbinia/state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down Expand Up @@ -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}')
Expand All @@ -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}')
Expand Down

0 comments on commit e102b06

Please sign in to comment.