File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
apps/script_executor_worker/src/workflows Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import * as activities from '../activities/sync/member'
66import { ISyncMembersArgs } from '../types'
77
88const activity = proxyActivities < typeof activities > ( {
9- startToCloseTimeout : '30 minute ' ,
9+ startToCloseTimeout : '45 minutes ' ,
1010 retry : { maximumAttempts : 3 , backoffCoefficient : 3 } ,
1111} )
1212
Original file line number Diff line number Diff line change @@ -42,19 +42,23 @@ export class MemberRepository extends RepositoryBase<MemberRepository> {
4242 }
4343
4444 public async getMembersForSync ( perPage : number ) : Promise < string [ ] > {
45- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4645 const results = await this . db ( ) . any (
4746 `
48- select m.id
49- from members m
50- left join indexed_entities ie on m.id = ie.entity_id and ie.type = $(type)
51- where ie.entity_id is null
52- limit ${ perPage } ;` ,
47+ SELECT m.id
48+ FROM members m
49+ WHERE NOT EXISTS (
50+ SELECT 1
51+ FROM indexed_entities ie
52+ WHERE ie.entity_id = m.id
53+ AND ie.type = $(type)
54+ )
55+ ORDER BY m.id
56+ LIMIT ${ perPage } ;
57+ ` ,
5358 {
5459 type : IndexedEntityType . MEMBER ,
5560 } ,
5661 )
57-
5862 return results . map ( ( r ) => r . id )
5963 }
6064
You can’t perform that action at this time.
0 commit comments