Remove eager DB access in proxy AppConfig.ready()#14121
Remove eager DB access in proxy AppConfig.ready()#14121
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
…alization Agent-Logs-Url: https://github.com/GeoNode/geonode/sessions/6036f356-560b-4347-8a98-b5fff9c0bccb Co-authored-by: etj <717359+etj@users.noreply.github.com>
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
Agent-Logs-Url: https://github.com/GeoNode/geonode/sessions/6036f356-560b-4347-8a98-b5fff9c0bccb Co-authored-by: etj <717359+etj@users.noreply.github.com>
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
geonode.proxywas callingproxy_urls_registry.initialize()insideAppConfig.ready(), triggering a DB query at startup and causing Django to emit aRuntimeWarningabout database access during app initialization.The registry already supports lazy initialization —
get_proxy_allowed_hosts()re-initializes automatically when the cache is empty or stale — so there's no need to eagerly populate it at boot.Changes
geonode/proxy/apps.py: Removerun_setup_hooks()and itstry/exceptwrapper. WireLinkpost-save/post-delete signal handlers directly inready()(no DB access required).geonode/proxy/utils.py: Remove_first_initflag and signal-connection code frominitialize()— signals are now owned byAppConfig.ready(). Drop the unusedsignalsimport.