mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 13:58:47 +00:00
Only import tracing module if tracing is enabled (#6316)
This commit is contained in:
parent
d64fbfc254
commit
f85b773a50
@ -26,7 +26,6 @@ from dotenv import load_dotenv
|
|||||||
|
|
||||||
from InvenTree.config import get_boolean_setting, get_custom_file, get_setting
|
from InvenTree.config import get_boolean_setting, get_custom_file, get_setting
|
||||||
from InvenTree.sentry import default_sentry_dsn, init_sentry
|
from InvenTree.sentry import default_sentry_dsn, init_sentry
|
||||||
from InvenTree.tracing import setup_instruments, setup_tracing
|
|
||||||
from InvenTree.version import checkMinPythonVersion, inventreeApiVersion
|
from InvenTree.version import checkMinPythonVersion, inventreeApiVersion
|
||||||
|
|
||||||
from . import config, locales
|
from . import config, locales
|
||||||
@ -740,7 +739,10 @@ if SENTRY_ENABLED and SENTRY_DSN: # pragma: no cover
|
|||||||
TRACING_ENABLED = get_boolean_setting(
|
TRACING_ENABLED = get_boolean_setting(
|
||||||
'INVENTREE_TRACING_ENABLED', 'tracing.enabled', False
|
'INVENTREE_TRACING_ENABLED', 'tracing.enabled', False
|
||||||
)
|
)
|
||||||
|
|
||||||
if TRACING_ENABLED: # pragma: no cover
|
if TRACING_ENABLED: # pragma: no cover
|
||||||
|
from InvenTree.tracing import setup_instruments, setup_tracing
|
||||||
|
|
||||||
_t_endpoint = get_setting('INVENTREE_TRACING_ENDPOINT', 'tracing.endpoint', None)
|
_t_endpoint = get_setting('INVENTREE_TRACING_ENDPOINT', 'tracing.endpoint', None)
|
||||||
_t_headers = get_setting('INVENTREE_TRACING_HEADERS', 'tracing.headers', None, dict)
|
_t_headers = get_setting('INVENTREE_TRACING_HEADERS', 'tracing.headers', None, dict)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user