Skip to content

Commit

Permalink
default to maxsize 1
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed Feb 18, 2025
1 parent 7c69c79 commit 62dedb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,11 @@ def __init__(
self.prefetch_count_mapping = prefetch_count_mapping

# Limit the local queue size to the maximum prefetch count size
max_queue_length = max([self.prefetch_count_mapping[q] for q in self.queues])
max_queue_length = max(
[self.prefetch_count_mapping[q] for q in self.queues], default=1
)
self.local_queue = Queue(maxsize=max_queue_length)
log.info(f"local_queue initialized with max_size={max_queue_length}")
log.info(f"local_queue initialized with maxsize={max_queue_length}")

def run_prometheus_server(self):
if not settings.PROMETHEUS_ENABLED:
Expand Down

0 comments on commit 62dedb5

Please sign in to comment.