1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-03 17:55:52 +03:00

Fixed issues with poller in production. Fixes #3

Этот коммит содержится в:
Max Melentiev
2016-05-31 11:46:58 +03:00
родитель 5fef6fb43a
Коммит 8077ef9bcf
2 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@@ -14,9 +14,14 @@ module Telegram
# It just tells routes helpers whether to add routed bots to
# Bot::UpdatesPoller, so their config will be available by bot key in
# Bot::UpdatesPoller.start.
#
# It's enabled by default in Rails dev environment and `rake telegram:bot:poller`
# task. Use `BOT_POLLER_MODE=true` envvar to set it manually.
def bot_poller_mode?
return @bot_poller_mode if defined?(@bot_poller_mode)
Rails.env.development? if defined?(Rails)
@bot_poller_mode = ENV.fetch('BOT_POLLER_MODE') do
Rails.env.development? if defined?(Rails)
end
end
# Hash of bots made with bots_config.