Skip to content

Commit

Permalink
fix cyclic import warning
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBarberini committed Jun 14, 2024
1 parent 32e94d8 commit 49a629b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ RUN apt-get update && \

COPY ./lib /app/lib

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"]
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"]
3 changes: 0 additions & 3 deletions lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ def parse_error(error):
exc_type = type(error).__name__
exc_obj = f"{error}".replace("\n", " ").replace(" ", " ")
return f"{exc_type} exception: {exc_obj}"


from .api import app # noqa
2 changes: 1 addition & 1 deletion lib/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# __main__.py
from lib import app
from lib.api import app

if __name__ == '__main__':
app.run()
2 changes: 1 addition & 1 deletion lib/settings/gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def post_fork(server, worker): # pylint: disable=unused-argument
service_version="1.2.0",
deployment_environment="production",
)
from lib import ( # pylint: disable=import-outside-toplevel
from lib.api import ( # pylint: disable=import-outside-toplevel
app as fastapi_server,
)

Expand Down

0 comments on commit 49a629b

Please sign in to comment.