bito-code-review[bot] commented on PR #40652:
URL: https://github.com/apache/superset/pull/40652#issuecomment-4597643836
<!-- Bito Reply -->
The PR comment indicates a performance issue where the `/version` endpoint
always calls `get_version_metadata()` before checking `EXPOSE_VERSION_INFO`,
even when it's set to `False`. This results in unnecessary Git subprocess calls
and resource usage. To resolve this, the endpoint should first check
`EXPOSE_VERSION_INFO`, and if it's `False`, return `version_string` directly
from the config without invoking `get_version_metadata()`.
**superset/views/health.py**
```
def version():
if not app.config.get('EXPOSE_VERSION_INFO', True):
return {'version_string': app.config['VERSION_STRING']}
metadata = get_version_metadata()
return {'version_string': metadata['version_string']}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]