Skip to content

Commit 49a629b

Browse files
fix cyclic import warning
1 parent 32e94d8 commit 49a629b

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ RUN apt-get update && \
1616

1717
COPY ./lib /app/lib
1818

19-
CMD ["gunicorn", "-c", "lib/settings/gunicorn.py", "-w", "1", "--threads=2", "-k", "uvicorn.workers.UvicornWorker", "lib:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "30"]
19+
CMD ["gunicorn", "-c", "lib/settings/gunicorn.py", "-w", "1", "--threads=2", "-k", "uvicorn.workers.UvicornWorker", "lib.api:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "30"]

lib/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,3 @@ def parse_error(error):
2323
exc_type = type(error).__name__
2424
exc_obj = f"{error}".replace("\n", " ").replace(" ", " ")
2525
return f"{exc_type} exception: {exc_obj}"
26-
27-
28-
from .api import app # noqa

lib/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# __main__.py
2-
from lib import app
2+
from lib.api import app
33

44
if __name__ == '__main__':
55
app.run()

lib/settings/gunicorn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def post_fork(server, worker): # pylint: disable=unused-argument
1010
service_version="1.2.0",
1111
deployment_environment="production",
1212
)
13-
from lib import ( # pylint: disable=import-outside-toplevel
13+
from lib.api import ( # pylint: disable=import-outside-toplevel
1414
app as fastapi_server,
1515
)
1616

0 commit comments

Comments
 (0)