Skip to content

Commit

Permalink
fix: only get cpu cores in getAllSubmissions method
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Apr 2, 2024
1 parent 35462ca commit 6897b20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions osm_fieldwork/OdkCentral.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ def __init__(
# These are just cached data from the queries
self.projects = dict()
self.users = list()
# The number of threads is based on the CPU cores
info = get_cpu_info()
self.cores = info["count"]

def authenticate(
self,
Expand Down Expand Up @@ -430,6 +427,10 @@ def getAllSubmissions(self, project_id: int, xforms: list = None, filters: dict
Returns:
(json): All of the submissions for all of the XForm in a project
"""
# The number of threads is based on the CPU cores
info = get_cpu_info()
self.cores = info["count"]

timer = Timer(text="getAllSubmissions() took {seconds:.0f}s")
timer.start()
if not xforms:
Expand Down

0 comments on commit 6897b20

Please sign in to comment.