_execute API not working when watch is inactive

Created watch in inactive state, and tried using _execute API to execute manually. But, it is not executing and have to make watch active

Not sure of the cause - any fixes released for this or am I missing anything. Thanks for guidance.

Executing the watch when inctive results with

{
"_id": "mywatch_0e35eedd-346b-4a06-acf7-8452aaabc324-2018-03-02T22:54:50.994Z",
"watch_record": {
"watch_id": "mywatch",
"node": "I7NfChT4RzCk2axGnErXYg",
"state": "execution_not_needed",
"trigger_event": {
"type": "manual",
"triggered_time": "2018-03-02T22:54:50.994Z",
"manual": {
"schedule": {
"scheduled_time": "2018-03-02T22:54:50.994Z"
}
}
},
"messages": [
"Watch is not active"
]
}
}

Once made active, and executed - it send me the alert

Hi Karthik,

By default, when you add a watch it is immediately set to the active state, registered with the appropriate trigger engine, and executed according to its configured trigger.

You can also set a watch to the inactive state- which is what you did in ur case I guess. Inactive watches are not registered with a trigger engine and can never be triggered.

Hope this explains.

Thanks
Rashmi

I think we should allow executing inactive watches, as this is a request manually triggered. I will take a closer look, what is the complexity behind this - but should not be too hard.

--Alex

Thanks rashmi and alex.

Yes. I would also agree with Alex as executing a inactive watch explicitly should not require active status. Having active status to a watch would trigger it by schedule, and there could be reasons why a watch is made inactive temporarily and triggered explicitly.

FYI: This will work from 6.3.0 onwards.

1 Like

Great. Thanks Alex.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.