Command expiry

vrish2 months ago

Hi,
I have a requirement that I need to send a command to all my devices every X minutes. Its the same command that is sent every time. I'm able to send the commands via API. That's the easy part!

My question is in 2 parts: I want to ensure the commands are not queued, but expire. Is there a way to set an expiry on a command if its not delivered? If not, is there a way in which I could check if there is a command already in queue? Then I can skip the next instance of the command.

I couldn't find anything in the API.

Thanks
-VK

Anton Tananaev2 months ago

You can check in the database. I don't think we have an API. But I think it might be a good idea to have an option to not queue commands.

vrish2 months ago

Hmm.

I thought about the DB part, but I'm hosting the Traccar environment separately and I'm not comfortable opening the ports.

Thanks for the reply. Let me see if I can figure something out.
-VK

maclofin2 months ago

I'm not 100% sure but I remember that when the command is queue the response code is 204 and when the command is sent is 200, you can handle the action through that.

Anton Tananaev2 months ago

Oh yeah good point. But I think it's still a good idea to have an option to skip queue.