Steve-Mcl/node-red-contrib-cron-plus

Adding a schedule with the same name as an existing schedule will 'NOT' replace the existing one

Opened this issue · 1 comments

If I inject this payload, a schedule is created that fires once at 2am and then deactivates. I thought, based on the docs, that I could inject that same payload again and it would replace the existing one of the same name. However, the existing schedule still remains deactivated and does not fire again. Am I misunderstanding or is this suppose to behave as I expected.

Here's the section of the docs I'm referring to:
GENERAL NOTES... Adding a schedule with the same name as an existing schedule will replace the existing one

{
    "command": "add",
    "name": "someName",
    "expression": "0 0 2 * * ? *",
    "expressionType": "cron",
    "payloadType": "default",
    "limit": 1
}

This might be a quirk of the limit feature.

Until I get time to look into this, you could force it with remove command into the mix e.g.

[
  {
    "command": "remove",
    "name": "someName"
  },
  {
    "command": "add",
    "name": "someName",
    "expression": "0 0 2 * * ? *",
    "expressionType": "cron",
    "payloadType": "default",
    "limit": 1
  }
]