88import config from '../config.ts' ;
99import { runReliableQueue } from './store/queue.ts' ;
1010import c from 'ansi-colors' ;
11- import { buildReplayUrl , redisCount } from './util/utility.ts' ;
11+ import { buildReplayUrl , getParserCapacity , redisCount } from './util/utility.ts' ;
1212import redis from './store/redis.ts' ;
1313import { apiFetcher } from './fetcher/getApiData.ts' ;
1414import { parsedFetcher } from './fetcher/getParsedData.ts' ;
@@ -17,8 +17,6 @@ import { getPGroup } from './util/pgroup.ts';
1717import moment from 'moment' ;
1818import { queueReconcile } from './util/insert.ts' ;
1919
20- const { PARSER_PARALLELISM } = config ;
21-
2220async function parseProcessor ( job : ParseJob , metadata : JobMetadata ) {
2321 const start = Date . now ( ) ;
2422 let apiTime = 0 ;
@@ -164,15 +162,9 @@ async function parseProcessor(job: ParseJob, metadata: JobMetadata) {
164162 }
165163 }
166164}
167- async function getCapacity ( ) {
168- if ( config . USE_SERVICE_REGISTRY ) {
169- return redis . zcard ( 'registry:parser' ) ;
170- }
171- return Number ( PARSER_PARALLELISM ) ;
172- }
173165runReliableQueue (
174166 'parse' ,
175- Number ( PARSER_PARALLELISM ) ,
167+ Number ( config . PARSER_PARALLELISM ) ,
176168 parseProcessor ,
177- getCapacity ,
169+ getParserCapacity ,
178170) ;
0 commit comments