File tree Expand file tree Collapse file tree
services/apps/merge_suggestions_worker/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { ScheduleAlreadyRunning , ScheduleOverlapPolicy } from '@temporalio/client'
22
3- import { IS_DEV_ENV , IS_TEST_ENV } from '@crowd/common'
3+ import { DEFAULT_TENANT_ID } from '@crowd/common'
44
55import { svc } from '../main'
6- import { spawnMemberMergeSuggestionsForAllTenants } from '../workflows/spawnMemberMergeSuggestionsForAllTenants '
6+ import { generateMemberMergeSuggestions } from '../workflows/generateMemberMergeSuggestions '
77
88export const scheduleGenerateMemberMergeSuggestions = async ( ) => {
99 try {
1010 await svc . temporal . schedule . create ( {
1111 scheduleId : 'member-merge-suggestions' ,
12- spec :
13- IS_DEV_ENV || IS_TEST_ENV
14- ? {
15- cronExpressions : [ '*/2 * * * *' ] ,
16- }
17- : {
18- intervals : [
19- {
20- every : '2 hours' ,
21- } ,
22- ] ,
23- } ,
12+ spec : {
13+ cronExpressions : [ '0 */2 * * *' ] ,
14+ } ,
2415 policies : {
2516 overlap : ScheduleOverlapPolicy . BUFFER_ONE ,
2617 catchupWindow : '1 minute' ,
2718 } ,
2819 action : {
2920 type : 'startWorkflow' ,
30- workflowType : spawnMemberMergeSuggestionsForAllTenants ,
21+ workflowType : generateMemberMergeSuggestions ,
3122 taskQueue : 'merge-suggestions' ,
32- workflowExecutionTimeout : '5 minutes' ,
23+ args : [
24+ {
25+ tenantId : DEFAULT_TENANT_ID ,
26+ } ,
27+ ] ,
3328 } ,
3429 } )
3530 } catch ( err ) {
Original file line number Diff line number Diff line change 11import { ScheduleAlreadyRunning , ScheduleOverlapPolicy } from '@temporalio/client'
22
3- import { IS_DEV_ENV , IS_TEST_ENV } from '@crowd/common'
3+ import { DEFAULT_TENANT_ID } from '@crowd/common'
44
55import { svc } from '../main'
6- import { spawnOrganizationMergeSuggestionsForAllTenants } from '../workflows/spawnOrganizationMergeSuggestionsForAllTenants '
6+ import { generateOrganizationMergeSuggestions } from '../workflows/generateOrganizationMergeSuggestions '
77
88export const scheduleGenerateOrganizationMergeSuggestions = async ( ) => {
99 try {
1010 await svc . temporal . schedule . create ( {
1111 scheduleId : 'organization-merge-suggestions' ,
12- spec :
13- IS_DEV_ENV || IS_TEST_ENV
14- ? {
15- cronExpressions : [ '*/2 * * * *' ] ,
16- }
17- : {
18- intervals : [
19- {
20- every : '2 hours' ,
21- } ,
22- ] ,
23- } ,
12+ spec : {
13+ cronExpressions : [ '0 */2 * * *' ] ,
14+ } ,
2415 policies : {
2516 overlap : ScheduleOverlapPolicy . BUFFER_ONE ,
2617 catchupWindow : '1 minute' ,
2718 } ,
2819 action : {
2920 type : 'startWorkflow' ,
30- workflowType : spawnOrganizationMergeSuggestionsForAllTenants ,
21+ workflowType : generateOrganizationMergeSuggestions ,
3122 taskQueue : 'merge-suggestions' ,
32- workflowExecutionTimeout : '5 minutes' ,
23+ args : [
24+ {
25+ tenantId : DEFAULT_TENANT_ID ,
26+ } ,
27+ ] ,
3328 } ,
3429 } )
3530 } catch ( err ) {
Original file line number Diff line number Diff line change @@ -2,15 +2,11 @@ import { generateMemberMergeSuggestions } from './workflows/generateMemberMergeS
22import { generateOrganizationMergeSuggestions } from './workflows/generateOrganizationMergeSuggestions'
33import { mergeMembersWithLLM } from './workflows/mergeMembersWithLLM'
44import { mergeOrganizationsWithLLM } from './workflows/mergeOrganizationsWithLLM'
5- import { spawnMemberMergeSuggestionsForAllTenants } from './workflows/spawnMemberMergeSuggestionsForAllTenants'
6- import { spawnOrganizationMergeSuggestionsForAllTenants } from './workflows/spawnOrganizationMergeSuggestionsForAllTenants'
75import { testMergingEntitiesWithLLM } from './workflows/testMergingEntitiesWithLLM'
86
97export {
108 generateMemberMergeSuggestions ,
11- spawnMemberMergeSuggestionsForAllTenants ,
129 generateOrganizationMergeSuggestions ,
13- spawnOrganizationMergeSuggestionsForAllTenants ,
1410 testMergingEntitiesWithLLM ,
1511 mergeOrganizationsWithLLM ,
1612 mergeMembersWithLLM ,
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments