Skip to content

Commit

Permalink
reduce max page size
Browse files Browse the repository at this point in the history
  • Loading branch information
zandre-eng committed Jan 17, 2025
1 parent 93d7445 commit d5752a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions corehq/apps/geospatial/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class CaseManagementMap(BaseCaseMapReport):

base_template = "geospatial/case_management_base.html"
report_template_path = "geospatial/case_management.html"
max_rows = 7_000
default_rows = 7_000
max_rows = 5_000
default_rows = 5_000
force_page_size = True

def default_report_url(self):
Expand Down Expand Up @@ -134,6 +134,9 @@ def headers(self):

@property
def rows(self):
from time import time

start = time()
cases = []
for row in self.es_results['hits'].get('hits', []):
display = CaseDisplayES(
Expand All @@ -147,6 +150,8 @@ def rows(self):
display.case_link,
display.case_name,
])
end = time() - start
print("Total time:", end)
return cases


Expand Down
2 changes: 1 addition & 1 deletion corehq/apps/geospatial/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class CasesReassignmentView(BaseDomainView):
REQUEST_CASES_LIMIT = CaseManagementMap.default_rows
# Below values denotes the number of cases to be reassigned including the related cases
ASYNC_CASES_UPDATE_THRESHOLD = 500 # threshold for asynchronous operation
TOTAL_CASES_LIMIT = 14_000 # maximum number of cases that can be reassigned
TOTAL_CASES_LIMIT = 10_000 # maximum number of cases that can be reassigned

def post(self, request, domain, *args, **kwargs):
try:
Expand Down

0 comments on commit d5752a9

Please sign in to comment.