-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Filter out certain executions from crash recovery (#9904)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <[email protected]>
- Loading branch information
Showing
12 changed files
with
217 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/cli/src/eventbus/EventMessageClasses/EventMessageExecution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { AbstractEventMessage, isEventMessageOptionsWithType } from './AbstractEventMessage'; | ||
import type { JsonObject } from 'n8n-workflow'; | ||
import { EventMessageTypeNames } from 'n8n-workflow'; | ||
import type { AbstractEventMessageOptions } from './AbstractEventMessageOptions'; | ||
import type { AbstractEventPayload } from './AbstractEventPayload'; | ||
import type { EventNamesExecutionType } from '.'; | ||
|
||
export interface EventPayloadExecution extends AbstractEventPayload { | ||
executionId: string; | ||
} | ||
|
||
export interface EventMessageExecutionOptions extends AbstractEventMessageOptions { | ||
eventName: EventNamesExecutionType; | ||
|
||
payload?: EventPayloadExecution; | ||
} | ||
|
||
export class EventMessageExecution extends AbstractEventMessage { | ||
readonly __type = EventMessageTypeNames.execution; | ||
|
||
eventName: EventNamesExecutionType; | ||
|
||
payload: EventPayloadExecution; | ||
|
||
constructor(options: EventMessageExecutionOptions) { | ||
super(options); | ||
if (options.payload) this.setPayload(options.payload); | ||
if (options.anonymize) { | ||
this.anonymize(); | ||
} | ||
} | ||
|
||
setPayload(payload: EventPayloadExecution): this { | ||
this.payload = payload; | ||
return this; | ||
} | ||
|
||
deserialize(data: JsonObject): this { | ||
if (isEventMessageOptionsWithType(data, this.__type)) { | ||
this.setOptionsOrDefault(data); | ||
if (data.payload) this.setPayload(data.payload as EventPayloadExecution); | ||
} | ||
return this; | ||
} | ||
} |
Oops, something went wrong.