We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c4f5b5 commit 312f46aCopy full SHA for 312f46a
optimade/server/entry_collections/mongo.py
@@ -195,6 +195,9 @@ def _run_db_query(
195
criteria_nolimit = criteria.copy()
196
criteria_nolimit.pop("limit", None)
197
skip = criteria_nolimit.pop("skip", 0)
198
+ # If we're on the first page, set a much higher timeout for counting the results (10 s)
199
+ if skip == 0:
200
+ criteria_nolimit["maxTimeMS"] = 1000 * 10
201
data_returned = self.count(**criteria_nolimit)
202
# Only correct most of the time: if the total number of remaining results is exactly the page limit
203
# then this will incorrectly say there is more_data_available
0 commit comments