File tree Expand file tree Collapse file tree
services/apps/data_sink_worker/src/bin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import MemberAttributeService from '../service/memberAttribute.service'
1414
1515/* eslint-disable @typescript-eslint/no-explicit-any */
1616
17+ const BATCH_SIZE = process . env . TEST_RUN ? 1 : 5000
18+
1719const log = getServiceLogger ( )
1820
1921async function getMemberIds (
@@ -44,7 +46,7 @@ async function getMemberIds(
4446 and coalesce(kv.value, '') != '')
4547 ${ lastId ? `and id < '${ lastId } '` : '' }
4648 order by id desc
47- limit 5000 )
49+ limit ${ BATCH_SIZE } )
4850select m.id, m.attributes
4951from members m
5052 inner join
@@ -254,6 +256,10 @@ setImmediate(async () => {
254256 const lastId = membersToFix [ membersToFix . length - 1 ] . id
255257 log . debug ( { lastId } , 'Fetching next batch starting from last ID' )
256258
259+ if ( process . env . TEST_RUN ) {
260+ break
261+ }
262+
257263 membersToFix = await getMemberIds ( dbClient , lastId )
258264 log . info ( { count : membersToFix . length } , 'Found members for next batch' )
259265
You can’t perform that action at this time.
0 commit comments