Esmaill1 commited on
Commit
f9352ca
·
1 Parent(s): f7c03f5

Fix: Disable PTB signal handling for thread safety and enable unbuffered logs

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. bot.py +2 -1
Dockerfile CHANGED
@@ -3,6 +3,9 @@ FROM python:3.9
3
  # Set working directory
4
  WORKDIR /app
5
 
 
 
 
6
  # Install system dependencies (including ca-certificates explicitly)
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  gcc \
 
3
  # Set working directory
4
  WORKDIR /app
5
 
6
+ # Ensure logs are visible immediately
7
+ ENV PYTHONUNBUFFERED=1
8
+
9
  # Install system dependencies (including ca-certificates explicitly)
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  gcc \
bot.py CHANGED
@@ -494,7 +494,8 @@ def main():
494
 
495
  # Start the bot
496
  logger.info("Starting bot...")
497
- application.run_polling(allowed_updates=Update.ALL_TYPES)
 
498
 
499
 
500
  if __name__ == "__main__":
 
494
 
495
  # Start the bot
496
  logger.info("Starting bot...")
497
+ # Disable signal handling because we run in a thread in app.py
498
+ application.run_polling(allowed_updates=Update.ALL_TYPES, stop_signals=None)
499
 
500
 
501
  if __name__ == "__main__":