Are you running an api server? When you initialize the server, I would create the engine as a sort of singleton/global variable.
You might have to check the connection and reconnect as needed, but at least it would limit the time spent waiting
For example, in this demo, I keep a vector index as a global, shared across all functions (a similar principle)
https://github.com/logan-markewich/llama_index_starter_pack/blob/main/flask_react/index_server.py