Closed nidico closed 10 years ago
I could not reproduce the issue i.e. I could not trigger the debug messages described in 94c7483. Can you give more detailed information on how to trigger/where to find them?
These messages are not thrown anymore due to the changes in that commit, which basically just changes that Adhocracy no more tries to find the non-existing diazo paths in non-existant localhost
subdomain, but in the global scope.
If you want to reproduce the issue, open an ipdb
in InstanceDiscriminatorMiddleware.__call__
and look at environ['HTTP_HOST']
and environ['PATH_INFO']
. You'll end up 9 times in this breakpoint.
Ok, I can see the point. merging.
If the diazo rules path isn't forced to use the file protocol, diazo first tries to resolve the rules files (rules.xml, rules_notheme.xml, rules_header.xml etc.) from the Adhocracy server. As these paths do not exist, Adhocracy returns the /error/document page with status code 404 and Diazo then tries to find the file in the filesystem. In most themes this results in 4*2=8 unsuccessful calls to Adhocracy on system startup.
Therefore system startup performance is increased significantly on systems using diazo theming.
Note that this would finally fix the "No such instance: localhost, defaulting" warnings which were only silenced in 94c74831e3992af212ac2c59f7ad9ec947cd82ae.