-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for nested context manager use
This commit adds support for nested use of the UsePrimaryDB context manager. If a new instance of the context manager was created at each level we could use instance variables to store the pinning state but the class object is generally used directly. Instead, we store a stack of pinning values locally in the thread and pop each value as we unwind the stack.
- Loading branch information
1 parent
f984772
commit 534d1e9
Showing
2 changed files
with
56 additions
and
3 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