Skip to content

Commit

Permalink
fix: made it really work on production
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasZick committed Mar 7, 2023
1 parent b2e5f44 commit de1b2ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion animals_bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ class CONFIG:
# NOTSET - DEBUG - INFO - WARN - ERROR - CRITICAL
LOGLEVEL = environ.get("LOGLEVEL", "INFO")

TESTE = environ.get("TESTE", '')
TEST = environ.get("TEST", '')
13 changes: 7 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def health():

def start():
Process(target=Bot.run).start()
app.run(host="0.0.0.0", port=int(CONFIG.PORT))
if CONFIG.TEST != '':
app.run(host="0.0.0.0", port=int(CONFIG.PORT))
else:
from waitress import serve
serve(app, host="0.0.0.0", port=int(CONFIG.PORT))

if CONFIG.TESTE != '':
start()
elif __name__ == "__main__":
from waitress import serve
serve(app, host="0.0.0.0", port=int(CONFIG.PORT))
if __name__ == "__main__":
start()
2 changes: 1 addition & 1 deletion dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ENV REDIS_URL 'redis://172.17.0.1:6379'
ENV LOOKUP_TIMEOUT '30'
ENV LOGLEVEL 'INFO'
ENV PORT '3030'
ENV TESTE ''
ENV TEST ''


CMD [ "python3", "app.py" ]

0 comments on commit de1b2ea

Please sign in to comment.