I am running long queries(ecto version > 3) based on users params but I want to kill the query if query takes longer than 10 seconds and return error response.
One way I find (if I understand it correctly) is to set-statement-timeout on each query before running (if I can set it for a dedicated user that would be great). What is the best workaround/solution to kill the query/function which takes longer than 10 seconds.
Any help/workaround is appreciated. Thanks