Skip to content

Commit

Permalink
Merge pull request #4152 from novuhq/nv-2824-websockets-simplify-the-…
Browse files Browse the repository at this point in the history
…job-events-created-when-sending-an

feat(ws): simplify events for web sockets queue for performance
  • Loading branch information
Pablo Fernández authored Sep 13, 2023
2 parents e3bd728 + 1f9a74b commit 31eb912
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export class SendMessageInApp extends SendMessageBase {
);

await this.webSocketsQueueService.bullMqService.add(
`sendMessage-received-${message._id}`,
message._id,
{
event: WebSocketEventEnum.RECEIVED,
userId: command._subscriberId,
Expand All @@ -260,28 +260,6 @@ export class SendMessageInApp extends SendMessageBase {
command.organizationId
);

await this.webSocketsQueueService.bullMqService.add(
`sendMessage-unseen-${message._id}`,
{
event: WebSocketEventEnum.UNSEEN,
userId: command._subscriberId,
_environmentId: command.environmentId,
},
{},
command.organizationId
);

await this.webSocketsQueueService.bullMqService.add(
`sendMessage-unread-${message._id}`,
{
event: WebSocketEventEnum.UNREAD,
userId: command._subscriberId,
_environmentId: command.environmentId,
},
{},
command.organizationId
);

await this.createExecutionDetails.execute(
CreateExecutionDetailsCommand.create({
...CreateExecutionDetailsCommand.getDetailsFromJob(command.job),
Expand Down
Loading

0 comments on commit 31eb912

Please sign in to comment.