Task timeout not considered for offline devices

Hi,

it seems when issuing tasks (e.g. rebooting a CPE) for offline devices, the timeout parameter along the connection_request parameter is not considered. It seems the call always blocks for ~2 seconds.

Connection request with no timeout:

$ time curl -i 'http://localhost:7557/devices/00040E-FRITZ%2521Box-2C91ABD32E93/tasks?connection_request' -X POST --data '{ "name": "reboot" }'
HTTP/1.1 202 Device is offline
GenieACS-Version: 1.2.8+20211027200938
Content-Type: application/json
Date: Wed, 16 Feb 2022 14:04:16 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

{"name":"reboot","device":"00040E-FRITZ%21Box-2C91ABD32E93","timestamp":"2022-02-16T14:04:14.786Z","_id":"620d045e88cdb4c6f6dfc8b1"}
real 0m2.063s
user 0m0.004s
sys 0m0.003s

Connection request with 5 second timeout:

$ time curl -i 'http://localhost:7557/devices/00040E-FRITZ%2521Box-2C91ABD32E93/tasks?connection_request&timeout=5000' -X POST --data '{ "name": "reboot" }'
HTTP/1.1 202 Device is offline
GenieACS-Version: 1.2.8+20211027200938
Content-Type: application/json
Date: Wed, 16 Feb 2022 14:04:38 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

{"name":"reboot","device":"00040E-FRITZ%21Box-2C91ABD32E93","timestamp":"2022-02-16T14:04:36.474Z","_id":"620d04748701404bab706973"}
real 0m2.070s
user 0m0.001s
sys 0m0.005s

Connection request with 1 milisecond timeout:

$ time curl -i 'http://localhost:7557/devices/00040E-FRITZ%2521Box-2C91ABD32E93/tasks?connection_request&timeout=1' -X POST --data '{ "name": "reboot" }'
HTTP/1.1 202 Device is offline
GenieACS-Version: 1.2.8+20211027200938
Content-Type: application/json
Date: Wed, 16 Feb 2022 14:04:31 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

{"name":"reboot","device":"00040E-FRITZ%21Box-2C91ABD32E93","timestamp":"2022-02-16T14:04:29.243Z","_id":"620d046d6c4621eece4ef287"}
real 0m2.069s
user 0m0.001s
sys 0m0.005s

As one can see the API always blocks for ~2 seconds irrespective of the timeout parameter for an offline device.