Skip to content

Commit

Permalink
fix: Omnichannel Jobs running every 5 seconds (#32186)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman authored Apr 17, 2024
1 parent ada4c78 commit 706a3c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chilly-glasses-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Increased the timeout between calls for the three remaining Omnichannel Agenda Jobs. This should make them happen less often and reduce the load on MongoDB
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class AutoCloseOnHoldSchedulerClass {
mongo: (MongoInternals.defaultRemoteCollectionDriver().mongo as any).client.db(),
db: { collection: SCHEDULER_NAME },
defaultConcurrency: 1,
processEvery: '1 minute',
});

await this.scheduler.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AutoTransferChatSchedulerClass {
mongo: (MongoInternals.defaultRemoteCollectionDriver().mongo as any).client.db(),
db: { collection: SCHEDULER_NAME },
defaultConcurrency: 1,
processEvery: '1 minute',
});

await this.scheduler.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class OmnichannelQueueInactivityMonitorClass {
mongo: (MongoInternals.defaultRemoteCollectionDriver().mongo as any).client.db(),
db: { collection: SCHEDULER_NAME },
defaultConcurrency: 1,
processEvery: '1 minute',
});
this.createIndex();
const language = settings.get<string>('Language') || 'en';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ test.describe('omnichannel-auto-onhold-chat-closing', () => {
await poLiveChat.btnSendMessageToOnlineAgent.click();
});

test('expect on-hold chat to be closed automatically in 5 seconds', async () => {
// Note: Skipping this test as the scheduler is gonna take 1 minute to process now
// And waiting for 1 minute in a test is horrible
test.skip('expect on-hold chat to be closed automatically in 5 seconds', async () => {
await agent.poHomeChannel.sidenav.openChat(newVisitor.name);
await agent.poHomeChannel.content.sendMessage('this_is_a_test_message_from_agent');

Expand Down

0 comments on commit 706a3c1

Please sign in to comment.