Skip to content

Commit

Permalink
Add a clarifying comment wrt thread limits in CaseListService
Browse files Browse the repository at this point in the history
  • Loading branch information
swrichards committed Oct 1, 2024
1 parent 3190ba6 commit 5cf9e4c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/open_inwoner/cms/cases/views/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ class CaseListService:
def __init__(self, request: HttpRequest):
self.request = request

# TODO: Ideally, this would be configured in light of:
# - a configured maximum number of threads and
# - the number of API groups configured
#
# However, distributing the available threads optimally in light of both
# constraints is not trivial, due to the total thread count being
# subject to cascading effects (each nested count is a multiple of its
# parent count). Hence, we provide some sane defaults for both the 1 and
# >1 case of API group count. Even with a small CPU count, these numbers
# should be fine, as the threads are primarily IO-bound.
if ZGWApiGroupConfig.objects.count() > 1:
self._thread_limits = {
"zgw_api_groups": 2,
Expand Down

0 comments on commit 5cf9e4c

Please sign in to comment.