Remove warning for limit

This commit is contained in:
Owen
2025-12-22 14:07:49 -05:00
parent 2e60ecec87
commit 221ee6a1c2
2 changed files with 12 additions and 9 deletions

View File

@@ -105,6 +105,7 @@ async function query(query: Q) {
// throw an error // throw an error
throw createHttpError( throw createHttpError(
HttpCode.BAD_REQUEST, HttpCode.BAD_REQUEST,
// todo: is this even possible?
`Too many distinct countries. Please narrow your query.` `Too many distinct countries. Please narrow your query.`
); );
} }

View File

@@ -219,15 +219,17 @@ async function queryUniqueFilterAttributes(
.limit(DISTINCT_LIMIT+1) .limit(DISTINCT_LIMIT+1)
]); ]);
if ( // TODO: for stuff like the paths this is too restrictive so lets just show some of the paths and the user needs to
uniqueActors.length > DISTINCT_LIMIT || // refine the time range to see what they need to see
uniqueLocations.length > DISTINCT_LIMIT || // if (
uniqueHosts.length > DISTINCT_LIMIT || // uniqueActors.length > DISTINCT_LIMIT ||
uniquePaths.length > DISTINCT_LIMIT || // uniqueLocations.length > DISTINCT_LIMIT ||
uniqueResources.length > DISTINCT_LIMIT // uniqueHosts.length > DISTINCT_LIMIT ||
) { // uniquePaths.length > DISTINCT_LIMIT ||
throw new Error("Too many distinct filter attributes to retrieve. Please refine your time range."); // uniqueResources.length > DISTINCT_LIMIT
} // ) {
// throw new Error("Too many distinct filter attributes to retrieve. Please refine your time range.");
// }
return { return {
actors: uniqueActors actors: uniqueActors