Allow to specify database statement timeout on RPC calls
It could happen that a using a function field searcher numerous time on the search bar will result in a huge query that can take up to some hours and more importantly eat up all the memory and CPU dedicated to the database.
Thankfully postgres has an option available on the sessions: statement_timeout
that allows to limit the time spent on each statement of the session.
The review implements this on the RPC level and adds it on search
, search_count
and on the global search.
I chose the delay somehow randomly.