mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
8b93f52b71
Summary: The correct workflow for using a multi-threaded connection pool for multiple DBs is to have a single shared pool for all the use-cases. The pool is smart enough to maintain separate "pools" for each DB locator and limit them to maximum 100 conn per key. In this diff I create a `OnceCell` connection pool that is initialized once and reused for every attempt to connect to the DB. The pool is stored in `MononokeAppData` in order to bind its lifetime to the lifetime of Mononoke app. Then it is passed down as a part of `MysqlOptions`. Unfortunately this makes `MysqlOptions` not copyable, so the diff also contains lots of "clones". Reviewed By: ahornby Differential Revision: D25055819 fbshipit-source-id: 21f7d4a89e657fc9f91bf22c56c6a7172fb76ee8 |
||
---|---|---|
.. | ||
helper_lib | ||
schemas | ||
src | ||
Cargo.toml |