From b95033024cfe3173d206720f08417001b8471d60 Mon Sep 17 00:00:00 2001 From: Aubin <60398825+aubin-tchoi@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:22:52 +0100 Subject: [PATCH] spread the confluence workflows every 2 hours instead of every hour (#9600) --- connectors/src/connectors/confluence/temporal/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connectors/src/connectors/confluence/temporal/client.ts b/connectors/src/connectors/confluence/temporal/client.ts index 1e2077c57ee5..a409d3e9d2f0 100644 --- a/connectors/src/connectors/confluence/temporal/client.ts +++ b/connectors/src/connectors/confluence/temporal/client.ts @@ -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 { @@ -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);