Skip to content

Commit c154c56

Browse files
authored
Fixed initialization if not install py-ms[all] (#101)
1 parent e9edd1b commit c154c56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyms/flask/app/create_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
from typing import Text
44

55
from flask import Flask
6-
from flask_opentracing import FlaskTracing
76

87
from pyms.config import get_conf
98
from pyms.config.conf import validate_conf
109
from pyms.constants import LOGGER_NAME, CONFIG_BASE
1110
from pyms.flask.healthcheck import healthcheck_blueprint
1211
from pyms.flask.services.driver import ServicesManager
1312
from pyms.logger import CustomJsonFormatter
14-
from pyms.utils import check_package_exists
13+
from pyms.utils import check_package_exists, import_from
1514

1615
logger = logging.getLogger(LOGGER_NAME)
1716

@@ -145,6 +144,7 @@ def init_tracer(self) -> None:
145144
:return: None
146145
"""
147146
if self._exists_service("tracer"):
147+
FlaskTracing = import_from("flask_opentracing", "FlaskTracing")
148148
client = self.tracer.get_client()
149149
self.application.tracer = FlaskTracing(client, True, self.application)
150150

0 commit comments

Comments
 (0)