@@ -13,7 +13,6 @@ const FORWARDS = 'forwards';
1313export const MAX_TIME_MS = process . env . MAX_TIME_MS
1414 ? Number ( process . env . MAX_TIME_MS )
1515 : 0 ;
16- export const MAX_SCAN = process . env . MAX_SCAN ? Number ( process . env . MAX_SCAN ) : 0 ;
1716
1817const sortDirectionToOperator = ( direction , paginationDirection ) => {
1918 if ( paginationDirection === FORWARDS ) {
@@ -71,9 +70,9 @@ const modelToCursor = (model, sort) => {
7170 return cursor ;
7271} ;
7372
74- const getLrsStatementCount = ( { orgFilter, maxTimeMS, maxScan , hint } ) => {
73+ const getLrsStatementCount = ( { orgFilter, maxTimeMS, hint } ) => {
7574 const LRS = getDBConnection ( ) . model ( 'Lrs' ) ;
76- const query = LRS . collection . find ( orgFilter , { } , { maxTimeMS, maxScan } ) ;
75+ const query = LRS . collection . find ( orgFilter , { } , { maxTimeMS } ) ;
7776 if ( hint ) query . hint ( hint ) ;
7877 return query
7978 . project ( { statementCount : 1 } )
@@ -149,8 +148,7 @@ async function getConnection({
149148 authInfo,
150149 hint,
151150 project,
152- maxTimeMS = MAX_TIME_MS ,
153- maxScan = MAX_SCAN
151+ maxTimeMS = MAX_TIME_MS
154152} ) {
155153 const modelName = this . modelName ;
156154 const actionName = 'view' ;
@@ -162,7 +160,7 @@ async function getConnection({
162160 actionName,
163161 } ) ;
164162
165- const query = this . find ( parsedScopeFilter , { } , { maxTimeMS, maxScan } ) ;
163+ const query = this . find ( parsedScopeFilter , { } , { maxTimeMS } ) ;
166164
167165 // apply sort
168166 query . sort ( sort ) ;
@@ -265,7 +263,6 @@ async function getCount({
265263 filter,
266264 authInfo,
267265 maxTimeMS = MAX_TIME_MS ,
268- maxScan = MAX_SCAN ,
269266 hint
270267} ) {
271268 const parsedScopeFilter = await getParsedScopedFilter ( {
@@ -283,11 +280,10 @@ async function getCount({
283280 return getLrsStatementCount ( {
284281 orgFilter : parsedScopeFilter ,
285282 maxTimeMS,
286- maxScan,
287283 hint
288284 } ) ;
289285 }
290- const query = this . find ( parsedScopeFilter , { } , { maxTimeMS, maxScan } ) ;
286+ const query = this . find ( parsedScopeFilter , { } , { maxTimeMS } ) ;
291287 if ( hint ) query . hint ( hint ) ;
292288 return query . select ( { _id : 0 , organisation : 1 } ) . countDocuments ( ) ;
293289}
0 commit comments