Skip to content
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

[connectors] Spread Confluence workflows every 2 hours #9600

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion connectors/src/connectors/confluence/temporal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export async function launchConfluenceSyncWorkflow(
const workflowId = makeConfluenceSyncWorkflowId(connector.id);

const minute = connector.id % 60; // Spread workflows across the hour.
const oddOrEvenHour = connector.id % 120 >= 60 ? 1 : 0; // Spread workflows on even or odd hours.

// When the workflow is inactive, we omit passing spaceIds as they are only used to signal modifications within a currently active full sync workflow.
try {
Expand All @@ -70,7 +71,7 @@ export async function launchConfluenceSyncWorkflow(
memo: {
connectorId,
},
cronSchedule: `${minute} * * * *`, // Every hour at minute `minute`.
cronSchedule: `${minute} ${oddOrEvenHour}/2 * * *`, // Every 2 hours at minute `minute`.
});
} catch (err) {
return new Err(err as Error);
Expand Down
Loading