-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework metrics db connection management.
This removes the use of a process global, and adds support for readonly connections to help reduce contention on the metrics db with multithreaded access. Adding readonly mode, and the initial PR feedback, led to a re-working of the connection management. Rather than re-use `lib.database.get_connection()`, we instead implement our own version. This gives us control, and allows us to efficiently assure appropriate set up as well as cleanly handle readonly connections. One small chnage with this - we cannot use an in-memory db in testing for the metrics db, as `mode=memory` is not compatible with setting `mode=ro`. Each test still gets their own db, but its on disk.
- Loading branch information
1 parent
e9ea46e
commit f7577d1
Showing
4 changed files
with
116 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters