mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-24 02:09:26 +08:00
feat(core): Use a 20 second lease for leased triggers (no-changelog)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9e8a3be954
commit
5dc07ca1dd
@@ -13,6 +13,9 @@ import { WorkflowTriggerLeaseHolder } from './workflow-trigger-lease-holder';
|
||||
|
||||
export const WORKFLOW_TRIGGER_LEASE_KIND = 'workflow-trigger';
|
||||
|
||||
/** Short enough that a crashed holder's triggers move within about 20 seconds. */
|
||||
const WORKFLOW_TRIGGER_LEASE_SECONDS = 20;
|
||||
|
||||
/** What a holder needs to arm one trigger node, and what hands the lease over when it changes. */
|
||||
export interface WorkflowTriggerLeaseData extends Record<string, unknown> {
|
||||
workflowId: string;
|
||||
@@ -47,6 +50,7 @@ export class WorkflowTriggerLeases {
|
||||
name: WORKFLOW_TRIGGER_LEASE_KIND,
|
||||
handler: this.holder,
|
||||
listDesired: async (keys) => await this.listDesired(keys),
|
||||
options: { leaseSeconds: WORKFLOW_TRIGGER_LEASE_SECONDS },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user