-
Notifications
You must be signed in to change notification settings - Fork 51
Support controller reuse across multiple NinjaExtraAPI instances
#293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #293 +/- ##
==========================================
- Coverage 98.01% 97.87% -0.14%
==========================================
Files 68 67 -1
Lines 2770 2824 +54
==========================================
+ Hits 2715 2764 +49
- Misses 55 60 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@jdiego Nice work here. Thanks. |
|
@eadwinCode done. |
Closes #287
Updated
NinjaExtraAPI.register_controllersto handle per-API isolation:and a fresh APIController to avoid shared global state.
_registered_controllers(WeakSet) to guard against duplicate registration on the same API._controller_clones(dict) to cache per-API clones and prevent creating multiple subclasses for the same original controller.Enhanced tests:
auto_discover_controllersrespectsauto_import=False.(distinct routers, correct
self.apibinding).