Skip to content

Commit 53e601a

Browse files
committed
fix: small issues and test
1 parent 6217c20 commit 53e601a

File tree

8 files changed

+30
-12
lines changed

8 files changed

+30
-12
lines changed

packages/twenty-server/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"jsdom": "~22.1.0",
2727
"jwt-decode": "^4.0.0",
2828
"lodash.differencewith": "^4.5.0",
29+
"lodash.omitby": "^4.6.0",
2930
"lodash.uniq": "^4.5.0",
3031
"lodash.uniqby": "^4.7.0",
3132
"passport": "^0.7.0",
@@ -40,6 +41,7 @@
4041
"@types/lodash.isequal": "^4.5.8",
4142
"@types/lodash.isobject": "^3.0.7",
4243
"@types/lodash.omit": "^4.5.9",
44+
"@types/lodash.omitby": "^4.6.9",
4345
"@types/lodash.snakecase": "^4.1.7",
4446
"@types/lodash.uniq": "^4.5.9",
4547
"@types/lodash.uniqby": "^4.7.9",

packages/twenty-server/src/engine/integrations/message-queue/drivers/bullmq.driver.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { OnModuleDestroy } from '@nestjs/common';
22

3+
import omitBy from 'lodash.omitby';
34
import { JobsOptions, Queue, QueueOptions, Worker } from 'bullmq';
45

56
import {
@@ -52,10 +53,13 @@ export class BullMQDriver implements MessageQueueDriver, OnModuleDestroy {
5253
// TODO: Correctly support for job.id
5354
await handler({ data: job.data, id: job.id ?? '', name: job.name });
5455
},
55-
{
56-
...this.options,
57-
concurrency: options?.concurrency,
58-
},
56+
omitBy(
57+
{
58+
...this.options,
59+
concurrency: options?.concurrency,
60+
},
61+
(value) => value === undefined,
62+
),
5963
);
6064

6165
this.workerMap[queueName] = worker;

packages/twenty-server/src/engine/integrations/message-queue/message-queue.explorer.ts

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export class MessageQueueExplorer implements OnModuleInit {
4242
),
4343
);
4444

45-
console.log('PROCESSORS', processors);
46-
4745
for (const wrapper of processors) {
4846
const { instance, metatype } = wrapper;
4947
const methodNames = this.metadataScanner.getAllMethodNames(instance);

packages/twenty-server/src/engine/workspace-manager/workspace-cleaner/commands/clean-inactive-workspaces.command.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type CleanInactiveWorkspacesCommandOptions = {
1515
})
1616
export class CleanInactiveWorkspacesCommand extends CommandRunner {
1717
constructor(
18-
@InjectMessageQueue(MessageQueue.taskAssignedQueue)
18+
@InjectMessageQueue(MessageQueue.cronQueue)
1919
private readonly messageQueueService: MessageQueueService,
2020
) {
2121
super();

packages/twenty-server/src/engine/workspace-manager/workspace-cleaner/crons/clean-inactive-workspace.job.ts

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ type WorkspaceToDeleteData = {
2929
daysSinceInactive: number;
3030
};
3131

32-
// TODO: Special case with two queues, is it working ?
33-
@Processor(MessageQueue.taskAssignedQueue)
3432
@Processor(MessageQueue.cronQueue)
3533
export class CleanInactiveWorkspaceJob {
3634
private readonly logger = new Logger(CleanInactiveWorkspaceJob.name);

packages/twenty-server/src/modules/calendar/services/google-calendar-sync/google-calendar-sync.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class GoogleCalendarSyncService {
6262
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
6363
private readonly calendarEventCleanerService: CalendarEventCleanerService,
6464
private readonly calendarEventParticipantsService: CalendarEventParticipantService,
65-
@InjectMessageQueue(MessageQueue.emailQueue)
65+
@InjectMessageQueue(MessageQueue.messagingQueue)
6666
private readonly messageQueueService: MessageQueueService,
6767
) {}
6868

packages/twenty-server/src/modules/connected-account/auto-companies-and-contacts-creation/jobs/create-company-and-contact.job.ts

-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export type CreateCompanyAndContactJobData = {
1212
}[];
1313
};
1414

15-
// TODO: Was used on two queues previously, is it working ?
1615
@Processor(MessageQueue.messagingQueue)
17-
@Processor(MessageQueue.emailQueue)
1816
export class CreateCompanyAndContactJob {
1917
constructor(
2018
private readonly createCompanyAndContactService: CreateCompanyAndContactService,

yarn.lock

+18
Original file line numberDiff line numberDiff line change
@@ -17074,6 +17074,15 @@ __metadata:
1707417074
languageName: node
1707517075
linkType: hard
1707617076

17077+
"@types/lodash.omitby@npm:^4.6.9":
17078+
version: 4.6.9
17079+
resolution: "@types/lodash.omitby@npm:4.6.9"
17080+
dependencies:
17081+
"@types/lodash": "npm:*"
17082+
checksum: e8850219326634c5b531e3398d24701000328e4366504d9315c1660c2fe2a0d4fc9aa2983b8c652ee7239921cd16103b37b1e44efdf25658de2a36f64b76888a
17083+
languageName: node
17084+
linkType: hard
17085+
1707717086
"@types/lodash.pick@npm:^4.3.7":
1707817087
version: 4.4.9
1707917088
resolution: "@types/lodash.pick@npm:4.4.9"
@@ -34348,6 +34357,13 @@ __metadata:
3434834357
languageName: node
3434934358
linkType: hard
3435034359

34360+
"lodash.omitby@npm:^4.6.0":
34361+
version: 4.6.0
34362+
resolution: "lodash.omitby@npm:4.6.0"
34363+
checksum: 4608b1d8c4063b63349a3462852465fbe74781d737fbb26a0a7f00b0e65f6ccbc13fa490a38f9380103d93fc398e3873983038efadfafc67ccafbb25d9bc7bf4
34364+
languageName: node
34365+
linkType: hard
34366+
3435134367
"lodash.once@npm:^4.0.0":
3435234368
version: 4.1.1
3435334369
resolution: "lodash.once@npm:4.1.1"
@@ -46738,6 +46754,7 @@ __metadata:
4673846754
"@types/lodash.isequal": "npm:^4.5.8"
4673946755
"@types/lodash.isobject": "npm:^3.0.7"
4674046756
"@types/lodash.omit": "npm:^4.5.9"
46757+
"@types/lodash.omitby": "npm:^4.6.9"
4674146758
"@types/lodash.snakecase": "npm:^4.1.7"
4674246759
"@types/lodash.uniq": "npm:^4.5.9"
4674346760
"@types/lodash.uniqby": "npm:^4.7.9"
@@ -46750,6 +46767,7 @@ __metadata:
4675046767
jsdom: "npm:~22.1.0"
4675146768
jwt-decode: "npm:^4.0.0"
4675246769
lodash.differencewith: "npm:^4.5.0"
46770+
lodash.omitby: "npm:^4.6.0"
4675346771
lodash.uniq: "npm:^4.5.0"
4675446772
lodash.uniqby: "npm:^4.7.0"
4675546773
passport: "npm:^0.7.0"

0 commit comments

Comments
 (0)