Sadeep Sachintha commited on
Commit
853c8a4
·
1 Parent(s): 2af6c84

fix: remove delete_webhook from production shutdown to resolve zero-downtime race condition

Browse files
Files changed (1) hide show
  1. main.py +1 -3
main.py CHANGED
@@ -171,9 +171,7 @@ async def lifespan(app: FastAPI):
171
 
172
  # Shutdown logic
173
  scheduler.shutdown()
174
- if settings.webhook_url:
175
- await bot.delete_webhook()
176
- else:
177
  if hasattr(app.state, "polling_task"):
178
  app.state.polling_task.cancel()
179
  try:
 
171
 
172
  # Shutdown logic
173
  scheduler.shutdown()
174
+ if not settings.webhook_url:
 
 
175
  if hasattr(app.state, "polling_task"):
176
  app.state.polling_task.cancel()
177
  try: