Skip to content

Commit 42c6a84

Browse files
authored
Pass the existing transaction to merge organizations on enrichment (#1661)
1 parent a680c23 commit 42c6a84

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

backend/src/services/IServiceOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export interface IServiceOptions {
1010
currentSegments: SegmentData[]
1111
database: any
1212
redis: RedisClient
13+
transaction?: any
1314
}

backend/src/services/premium/enrichment/organizationEnrichmentService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export default class OrganizationEnrichmentService extends LoggerBase {
168168

169169
// Check for an organization with the same website exists
170170
const existingOrg = await OrganizationRepository.findByDomain(org.website, this.options)
171-
const orgService = new OrganizationService(this.options)
171+
const orgService = new OrganizationService({ ...this.options, transaction })
172172

173173
if (existingOrg && existingOrg.id !== org.id) {
174174
await orgService.merge(existingOrg.id, org.id)

0 commit comments

Comments
 (0)