mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 00:52:55 +00:00
committed by
Rainer Killinger
parent
d110d60123
commit
e17db521e2
@@ -14,13 +14,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {
|
||||
SCConfigFile,
|
||||
SCMultiSearchRequest,
|
||||
SCMultiSearchResponse,
|
||||
SCMultiSearchRoute,
|
||||
SCSearchResponse,
|
||||
SCTooManyRequestsErrorResponse,
|
||||
} from '@openstapps/core';
|
||||
import {configFile} from '../common';
|
||||
import {BulkStorage} from '../storage/BulkStorage';
|
||||
import {createRoute} from './Route';
|
||||
|
||||
@@ -33,11 +33,10 @@ export const multiSearchRouter = createRoute<SCMultiSearchResponse | SCTooManyRe
|
||||
multiSearchRouteModel,
|
||||
async (request: SCMultiSearchRequest, app) => {
|
||||
|
||||
const config: SCConfigFile = app.get('config');
|
||||
const bulkMemory: BulkStorage = app.get('bulk');
|
||||
const queryNames = Object.keys(request);
|
||||
|
||||
if (queryNames.length > config.backend.maxMultiSearchRouteQueries) {
|
||||
if (queryNames.length > configFile.backend.maxMultiSearchRouteQueries) {
|
||||
throw new SCTooManyRequestsErrorResponse(app.get('isProductiveEnvironment'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user