Skip to content

Commit

Permalink
fix(core): Report when waitTill is invalid and handle it (#8356)
Browse files Browse the repository at this point in the history
  • Loading branch information
krynble committed Jan 17, 2024
1 parent 48a0f91 commit d5455d7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/cli/src/WaitTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ export class WaitTracker {
for (const execution of executions) {
const executionId = execution.id;
if (this.waitingExecutions[executionId] === undefined) {
if (!(execution.waitTill instanceof Date)) {
// n8n expects waitTill to be a date object
// but for some reason it's not being converted
// we are handling this like this since it seems to address the issue
// for some users, as reported by Jon when using a custom image.
// Once we figure out why this it not a Date object, we can remove this.
ErrorReporter.error('Wait Till is not a date object', {
extra: {
variableType: typeof execution.waitTill,
},
});
if (typeof execution.waitTill === 'string') {
execution.waitTill = new Date(execution.waitTill);
}
}
const triggerTime = execution.waitTill!.getTime() - new Date().getTime();
this.waitingExecutions[executionId] = {
executionId,
Expand Down

0 comments on commit d5455d7

Please sign in to comment.