Files
Zilant2025/gunicorn_bot.conf.py
T
2026-08-02 15:05:14 +03:00

17 lines
705 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Конфиг gunicorn для responder-бота.
Webhook регистрируется один раз в master (on_starting), а не в каждом worker —
иначе 4 воркера параллельно бьют setWebhook и ловят 429.
"""
def on_starting(server):
from tg_mainbot import setup_webhook
server.log.info("gunicorn on_starting: регистрация Telegram webhook через ретранслятор")
setup_webhook()
# На случай, если webhook уже стоит, а воркеры перезапускаются — не трогаем.
# Повторная регистрация только при старте master-процесса.