-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[messaging] add cronjob for workspaces messages partial sync #3800
[messaging] add cronjob for workspaces messages partial sync #3800
Conversation
async run(): Promise<void> { | ||
await this.messageQueueService.removeCron( | ||
FetchAllWorkspacesMessagesJob.name, | ||
fetchAllWorkspacesMessagesCronPattern, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bullmq needs the exact same pattern used by addCron when we want to remove a cron, pg-boss does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -77,6 +77,10 @@ export class GmailPartialSyncService { | |||
} | |||
|
|||
if (newHistoryId === lastSyncHistoryId) { | |||
console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use our logger!
Context
The current implementation does not automatically fetch new emails which means after the first full-sync we don't have a way to fetch upcoming emails unless we manually run a command. This PR aims to add a new cronJob that will enqueue the necessary jobs to fetch all workspaces connected accounts messages.
Note: CRON is set to run every 10 minutes.
Test