Is it normal that updating a service status using REST API call from client machine takes around 22 seconds?
I’m using Home Assistant Core version: core-2021.10.2 using Home Assistant OS Release-6 build 6 on raspberryPi
This behavior/delay happens only whenever I’m calling the REST API from a client machine using curl command as follows:
curl -X POST -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIxMDQyMWQ4NTA4ZDQ0OWJlOThkZmI1MzNmMWFlNTkzYiIsImlhdCI6MTYzNTc5OTkzMiwiZXhwIjoxOTUxMTU5OTMyfQ.6_e_5_q2X_PLgJtLC4vRPZrLfNDxW3tC3Sej4wGB624" -H "Content-Type: application/json" -d '{"entity_id": "switch.leaving_room_2nd_3rd_2**"}' http://homeassistant.local:8123/api/services/switch/turn_off
however if I tried to use homeassistant dashboard UI or even the Developer Tools >> Services call it switch off or on instantly without any delay.
Is it because of the Authorization token or something else? and how could I fix this issue?